agavra commented on code in PR #9818:
URL: https://github.com/apache/pinot/pull/9818#discussion_r1025881018


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/QueryEnvironment.java:
##########
@@ -129,6 +130,9 @@ public QueryPlan planQuery(String sqlQuery, 
SqlNodeAndOptions sqlNodeAndOptions)
       plannerContext.setOptions(sqlNodeAndOptions.getOptions());
       RelRoot relRoot = compileQuery(sqlNodeAndOptions.getSqlNode(), 
plannerContext);
       return toDispatchablePlan(relRoot, plannerContext);
+    } catch (CalciteContextException e) {
+      throw new RuntimeException("Error composing query plan for '" + sqlQuery
+          + "': " + e.getMessage() + "'", e);

Review Comment:
   This allows us to bubble up the error from the underlying message. e.g. 
instead of the user seeing `"Error composing query plan for : 'some sql'"` 
they'll see more details in the case of a `CalciteContextException`, which will 
give info like `Cannot use operator '=' to compare <STRING> and <INTEGER>`. I 
didn't want to bubble up any random exception because some might have really 
unehlpeful error messages, thats' why I separate out the clauses.



-- 
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-unsubscr...@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to