kgyrtkirk commented on code in PR #15195:
URL: https://github.com/apache/druid/pull/15195#discussion_r1364965909


##########
sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidSqlValidator.java:
##########
@@ -39,4 +44,23 @@ protected DruidSqlValidator(
   {
     super(opTab, catalogReader, typeFactory, validatorConfig);
   }
+
+  @Override
+  public void validateCall(SqlCall call, SqlValidatorScope scope)
+  {
+    if (call.getKind() == SqlKind.NULLS_FIRST) {
+      SqlNode op0 = call.getOperandList().get(0);
+      if (op0.getKind() == SqlKind.DESCENDING) {
+        throw InvalidSqlInput.exception("DESCENDING ordering with NULLS FIRST 
is not supported!");

Review Comment:
   initially I've used use validationError....but then I've seen a lot of place 
where `InvalidSqlInput` was used in similar situations like [here in the 
DruidSqlParserUtils](https://github.com/apache/druid/blame/a8febd457ceb184870dfbb11f6fe82b02dd1242d/sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlParserUtils.java#L247);
 and I was just "following the current practices"
   



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to