kmozaid commented on PR #17063:
URL: https://github.com/apache/pinot/pull/17063#issuecomment-3436098960

   Tested with query: `select avg(DivLongestGTimes) from airlineStats;` 
`DivLongestGTimes` is multi-value field -
   - Query works with single-stage query engine.
   - Quey fails with multi-stage query engine with below error during query 
compilation -
   ```
   Error Code: 700 (QueryValidationError)
   
   QueryValidationError: From line 1, column 8 to line 1, column 28: Cannot 
apply 'AVG' to arguments of type 'AVG(<INTEGER ARRAY>)'. Supported form(s): 
'AVG(<NUMERIC>)'
   ```
   The calcite AVG support only NUMERIC type. 
   
   If I make change in `AggregationFunctionType` to support ARRAY for AVG then 
query fails with error  -
   `Aggregate function: avg is already registered`.
   The change in `AggregationFunctionType` =>  `AVG("avg", ReturnTypes.DOUBLE, 
OperandTypes.or(OperandTypes.NUMERIC, OperandTypes.ARRAY), SqlTypeName.OTHER)`
   
   @yashmayya How can we handle this?
   
   


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