LakshSingla commented on code in PR #12558:
URL: https://github.com/apache/druid/pull/12558#discussion_r879032944
##########
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:
Since this is an error/check on the parsing side, it seems more in tune with
Calcite's Parser.jj where the parsing errors are thrown from the .jj file
itself. From a functional standpoint, they are equivalent. (It might be
beneficial to throw the error before creating a node in some cases, but I don't
think they apply here)
##########
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:
Since this is an error/check on the parsing side, it seems more in tune with
Calcite's Parser.jj where the parsing errors are thrown from the .jj file
itself. From a functional standpoint, they are equivalent. (It might be
beneficial to throw the error before creating a node in some cases, but I don't
think they apply here).
--
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]