jon-wei commented on a change in pull request #8775: Fix NPE for subquery with limit URL: https://github.com/apache/incubator-druid/pull/8775#discussion_r358422740
########## File path: sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidOuterQueryRel.java ########## @@ -128,9 +129,14 @@ public DruidQuery toDruidQuery(final boolean finalizeAggregations) return null; } + final GroupByQuery groupByQuery = subQuery.toGroupByQuery(); + if (groupByQuery == null) { + throw new CannotBuildQueryException("Subquery with limit clause is not supported"); Review comment: The exception message should be something like "Subquery could not be converted to GroupBy query", since it covers that broader case instead of just certain subqueries with limits. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org