You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/05/21 22:13:16 UTC

[GitHub] [druid] cryptoe commented on a diff in pull request #12558: Add error message for incorrectly ordered clause in sql

cryptoe commented on code in PR #12558:
URL: https://github.com/apache/druid/pull/12558#discussion_r878765879


##########
sql/src/main/codegen/includes/insert.ftl:
##########
@@ -36,6 +36,11 @@ SqlNode DruidSqlInsertEof() :
     <CLUSTERED> <BY>
     clusteredBy = ClusterItems()
   ]
+  {
+      if (clusteredBy != null && partitionedBy.lhs == null) {
+        throw new ParseException("CLUSTERED BY clause found before PARTITIONED BY, the PARITITIONED BY clause has to be specified first before the CLUSTERED BY clause.");

Review Comment:
   ```suggestion
           throw new ParseException("CLUSTERED BY found before PARTITIONED BY. In druid, the CLUSTERED BY clause has to be specified after the PARTITIONED BY clause");
   ```



##########
sql/src/main/codegen/includes/replace.ftl:
##########
@@ -56,6 +56,11 @@ SqlNode DruidSqlReplaceEof() :
       <CLUSTERED> <BY>
       clusteredBy = ClusterItems()
     ]
+    {
+        if (clusteredBy != null && partitionedBy.lhs == null) {
+          throw new ParseException("CLUSTERED BY clause found before PARTITIONED BY, the PARITITIONED BY clause has to be specified first before the CLUSTERED BY clause.");

Review Comment:
   ```suggestion
             throw new ParseException("CLUSTERED BY found before PARTITIONED BY. In druid, the CLUSTERED BY clause has to be specified after the PARTITIONED BY clause);
   ```



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org