Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/775#discussion_r104809964
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/work/metadata/ServerMetaProvider.java
---
@@ -76,7 +76,7 @@
.setReadOnly(false)
.setGroupBySupport(GroupBySupport.GB_UNRELATED)
.setLikeEscapeClauseSupported(true)
- .setNullCollation(NullCollation.NC_AT_END)
+ .setNullCollation(NullCollation.NC_HIGH)
--- End diff --
When sorting in Drill, the detailed sort spec is set in the
{{ExternalSort}} operator definition. This thing is a bit complex. One can
control sort order (ASC, DESC) and nulls position (LOW, HIGH, UNSPECIFIED.)
Data sorts according to ASC, DESC.
Nulls sort as follows:
HIGH: last if ASC, first if DESC
LOW: first if ASC, last if DESC
UNSPECIFIED: always high
If the planner has no way of setting the nulls ordering from a SQL query,
then the value is UNSPECIFIED, which means nulls always sort last as Jinfeng
explained.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---