danny0405 commented on a change in pull request #1474: [CALCITE-3370] Add NULL
direction emulation for MSSQL
URL: https://github.com/apache/calcite/pull/1474#discussion_r327902744
##########
File path:
core/src/main/java/org/apache/calcite/sql/dialect/MssqlSqlDialect.java
##########
@@ -61,6 +68,44 @@ public MssqlSqlDialect(Context context) {
top = context.databaseMajorVersion() < 11;
}
+ /**
+ * Emulate null FIRST/LAST with case statements.
+ */
+ @Override public SqlNode emulateNullDirection(SqlNode node, boolean
nullsFirst,
+ boolean desc) {
+ //Default ordering preserved
+ if (nullCollation.isDefaultOrder(nullsFirst, desc)) {
+ return null;
+ }
+
+ //Grouping node should preserve grouping, no emulation needed
+ if (node.getKind() == SqlKind.GROUPING) {
Review comment:
Left a whitespace between comment content and `//`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services