xiangfu0 opened a new pull request, #19986: URL: https://github.com/apache/pinot/pull/19986
## Summary Supports `FIRST_WITH_TIME(dataColumn, timeColumn)` and `LAST_WITH_TIME(dataColumn, timeColumn)` without the data type argument. Both query engines rewrite the call to the existing explicit form, `FIRST_WITH_TIME(dataColumn, timeColumn, 'dataType')`, using the data column's type: - **Single-stage:** `AggregateFunctionRewriteOptimizer`, for column operands. Unlike the existing MIN/MAX/SUM rewrites, this one does not require `autoRewriteAggregationType`. The optimizer now also visits aggregations nested under aliases, FILTER, HAVING and ORDER BY. - **Multi-stage:** the new `PinotAggregateTypeArgumentRewriteRule` (planner rule `AggregateTypeArgumentRewrite`). It projects the literal beneath the aggregate, so the plan matches the explicit form. The explicit form also accepts `'TIMESTAMP'`, which returns TIMESTAMP. Supported data types are INT, LONG, FLOAT, DOUBLE, STRING, BOOLEAN and TIMESTAMP. Only a TIMESTAMP data column requires upgraded servers; the other types are rewritten to forms that existing servers already execute. ## Tests - `AggregateFunctionRewriteOptimizerTest` (new) - New two-argument cases in `FirstWithTimeQueriesTest` and `LastWithTimeQueriesTest` - New plan cases in `AggregatePlans.json` - New runtime queries in `UDFAggregates.json` -- 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]
