LakshSingla commented on code in PR #15095:
URL: https://github.com/apache/druid/pull/15095#discussion_r1354855756
##########
sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/EarliestLatestAnySqlAggregator.java:
##########
@@ -313,12 +328,48 @@ public RelDataType inferReturnType(SqlOperatorBinding
sqlOperatorBinding)
}
}
+ private static class TimeColIdentifer extends SqlIdentifier
+ {
+
+ public TimeColIdentifer()
+ {
+ super("__time", SqlParserPos.ZERO);
+ }
+
+ @Override
+ public <R> R accept(SqlVisitor<R> visitor)
+ {
+
+ try {
+ return super.accept(visitor);
+ }
+ catch (CalciteContextException e) {
+ if (e.getCause() instanceof SqlValidatorException) {
+ throw DruidException.forPersona(DruidException.Persona.ADMIN)
Review Comment:
Perhaps here's the reason you are looking for:
https://github.com/apache/druid/blob/master/sql/src/main/java/org/apache/druid/sql/calcite/planner/QueryHandler.java#L692
However, in this case, it seems like we do know the exact reason why the
query failed - It's due to the absence of a time column. So perhaps change the
wording to be more assertive.
--
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]