somandal opened a new pull request, #10527:
URL: https://github.com/apache/pinot/pull/10527

   This PR adds support for the ranking `ROW_NUMBER()` window function in 
Apache Pinot. `ROW_NUMBER()` requires `ROW` type window function support rather 
than `RANGE` type for which we added support in Phase 1. This PR sets up a 
potential framework to use `ROW` type window functions but only implements this 
for `ROW_NUMBER()`. `ROW_NUMBER()` can be used in the following types of 
queries:
   
   - Empty `OVER()(s)` with some select column [see limitations below]
   - `OVER(ORDER BY)(s)`
   - `OVER(PARTITION BY)(s)`
   - `OVER(PARTITION BY ORDER BY)(s)`
   
   There are some limitations with `ROW_NUMBER()` which are:
   
   - Apache Calcite enforces the window function type to `ROW`. Due to the lack 
of support for multiple window groups today, `ROW_NUMBER()` cannot be combined 
with other window aggregation functions in the same query.
   - Queries which use an empty `OVER()` without any other column results in 
Apache Calcite not projecting any columns. E.g. query: `SELECT ROW_NUMBER() 
OVER() from table;`. I've added a TODO to look into how to get Apache Calcite 
to project at least one column in this scenario.
   
   The design document and issue for window functions support can be found 
below:
   
   - Design document for Phase 1: 
https://docs.google.com/document/d/13CmFm4djI09JKF_Xty5acoXxJoxC9CLXAsmikgzgtIs/edit?usp=sharing
   - Window functions Issue: https://github.com/apache/pinot/issues/7213
   
   cc @siddharthteotia @walterddr @vvivekiyer @ankitsultana


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