gargvishesh commented on code in PR #15095:
URL: https://github.com/apache/druid/pull/15095#discussion_r1348550510


##########
sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/EarliestLatestAnySqlAggregator.java:
##########
@@ -340,5 +345,47 @@ private static class EarliestLatestSqlAggFunction extends 
SqlAggFunction
           Optionality.FORBIDDEN
       );
     }
+
+    @Override
+    public SqlNode rewriteCall(
+        SqlValidator validator,
+        SqlCall call
+    )
+    {
+      // Rewrite EARLIEST to EARLIEST_BY and LATEST to LATEST_BY to make
+      // reference to __time column explicit so that Calcite tracks it
+
+      List<SqlNode> operands = call.getOperandList();
+
+      SqlParserPos pos = call.getParserPosition();
+
+      SqlAggFunction aggFunction;
+
+      switch (getName()) {

Review Comment:
   Modified to take the latter approach of passing the replacement 
SqlAggFunction in the constructor itself.



-- 
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]

Reply via email to