suneet-s commented on a change in pull request #10332:
URL: https://github.com/apache/druid/pull/10332#discussion_r485137792



##########
File path: 
sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/EarliestLatestAnySqlAggregator.java
##########
@@ -227,14 +257,14 @@ public Aggregation toDruidAggregation(
           aggregatorType.name(),
           null,
           SqlKind.OTHER_FUNCTION,
-          ReturnTypes.ARG0,
+          new EarliestLatestReturnTypeInference(0),
           InferTypes.RETURN_TYPE,
           OperandTypes.or(
               OperandTypes.NUMERIC,
               OperandTypes.BOOLEAN,
               OperandTypes.sequence(
                   "'" + aggregatorType.name() + "(expr, maxBytesPerString)'\n",
-                  OperandTypes.STRING,
+                  OperandTypes.ANY,

Review comment:
       Usually I sql add tests to `CalciteQueryTest` You can see 
`testEarliestAggregators` as an example. You could write a test in here to 
validate the SQL translation works, but I think you need to update 
`CalciteTests#INDEX_SCHEMA_DIFFERENT_DIM3_M1_TYPES` to add an earliest / latest 
aggregator. Then you should be able to test a SQL test in `CalciteQueryTest` - 
hope this helps




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to