FrankChen021 commented on pull request #10949:
URL: https://github.com/apache/druid/pull/10949#issuecomment-791299986


   One tricky problem left is that first/last aggregators is not supported by 
SQL query on reindexed long/float/double columns while these aggregators work 
well in a native query.
   
   The type of reindexed double/float/long/string first/last columns are marked 
as COMPLEX in schema, and the underlying type is lost when the type is 
converted into `RelDataType`. 
   
   
https://github.com/apache/druid/blob/16acd6686a337fc9a12e9aeda443fca973bdc625/sql/src/main/java/org/apache/druid/sql/calcite/table/RowSignatures.java#L135
   
   Since the underlying data type of the column is lost during SQL planning,  
current `EarliestLatestReturnTypeInference` also is not able to infer correct 
return type, and is unable to create correct type of aggregator for 
double/float/long.
   
   One way I can come up with is to define some macros such as double_latest 
for different data types at the SQL layer. 
   @gianm @clintropolis Do you have any other suggestions ?


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