GH-821 Add support for specifying ORDER BY null handling for supported dialects#1156
GH-821 Add support for specifying ORDER BY null handling for supported dialects#1156
Conversation
schauder
left a comment
There was a problem hiding this comment.
Good work.
I left a couple of comments. Just small stuff.
| * @author Chirag Tailor | ||
| */ | ||
| public interface OrderByOptionsSupport { | ||
| String resolve(@Nullable Sort.Direction direction, Sort.NullHandling nullHandling); |
There was a problem hiding this comment.
I also think this function lacks documentation. It is not clear from the first glance, ( at leas for me :) ) what exactly resolve function does. Maybe we can add javadoc upon it? @ctailor2 Chirag, what do you think?
There was a problem hiding this comment.
Agreed @mikhail2048, it wasn't very clear and I think that is largely because the two related but distinct concepts of Sort.Direction and Sort.NullHandling shouldn't be coupled together here. I moved the direction handling back out and and repurposed this interface to be for Sort.NullHandling only which hopefully makes the code more clear. I also added some more javadocs. Could you review my latest changes to see if these updates improve upon this?
Move ORDER BY direction evaluation back into OrderByClauseVisitor.
This makes the implementation more explicit and resilient to possible upstream code changes.
…s conform than do not.
|
Thanks. That's polished and merged. |
This adds support for specifying how null values should be handled when ordering query results, via the
NULLS FIRSTandNULLS LASToptions, for stores conforming to the SQL standard.Dialects for which null handling support was added:
Dialects with no current support for null handling:
Closes #821