You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/03/05 09:40:38 UTC

[GitHub] [druid] FrankChen021 commented on pull request #10949: Add support to first/last aggregators for numeric types during ingestion

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org