kgyrtkirk commented on code in PR #15670:
URL: https://github.com/apache/druid/pull/15670#discussion_r1450002617
##########
sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/EarliestLatestBySqlAggregator.java:
##########
@@ -165,6 +174,29 @@ public Aggregation toDruidAggregation(
);
}
+ private static boolean isMetricPreAggregated(PlannerContext plannerContext,
RexNode rexNode, String byAggregator)
+ {
+ final RelDataType type = rexNode.getType();
+ if (type instanceof RowSignatures.ComplexSqlType) {
+ String complexColumnTypeName = ((RowSignatures.ComplexSqlType)
type).getColumnType().getComplexTypeName();
+ if
((SerializablePairLongLongComplexMetricSerde.TYPE_NAME.equals(complexColumnTypeName)
+ ||
SerializablePairLongFloatComplexMetricSerde.TYPE_NAME.equals(complexColumnTypeName)
+ ||
SerializablePairLongDoubleComplexMetricSerde.TYPE_NAME.equals(complexColumnTypeName)
+ ||
SerializablePairLongStringComplexMetricSerde.TYPE_NAME.equals(complexColumnTypeName)))
{
+ plannerContext.setPlanningError(
+ "Cannot call %s with an explicit 'timeExpr' column for
pre-aggregated metric of type [%s]. Use %s instead "
Review Comment:
this doesn't look right to me - `EARLIEST/LATEST` is rewritten to their
`*_BY` variants by #15095
this message would suggest that something like:
```
@Test
public void testEarliestWorks1()
{
testBuilder()
.sql("SELECT EARLIEST(long_last_added) FROM wikipedia_first_last")
.run();
}
```
should pass - however it fails with the same error message
--
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]