yashmayya commented on code in PR #14233:
URL: https://github.com/apache/pinot/pull/14233#discussion_r1804044667
##########
pinot-query-planner/src/main/java/org/apache/pinot/calcite/rel/rules/PinotWindowExchangeNodeInsertRule.java:
##########
@@ -209,23 +244,37 @@ private void validateWindows(Window window) {
}
private void validateWindowAggCallsSupported(Window.Group windowGroup) {
- for (int i = 0; i < windowGroup.aggCalls.size(); i++) {
- Window.RexWinAggCall aggCall = windowGroup.aggCalls.get(i);
+ for (Window.RexWinAggCall aggCall : windowGroup.aggCalls) {
SqlKind aggKind = aggCall.getKind();
Preconditions.checkState(SUPPORTED_WINDOW_FUNCTION_KIND.contains(aggKind),
String.format("Unsupported Window function kind: %s. Only
aggregation functions are supported!", aggKind));
}
}
private void validateWindowFrames(Window.Group windowGroup) {
- // Has ROWS only aggregation call kind (e.g. ROW_NUMBER)?
- boolean isRowsOnlyTypeAggregateCall =
isRowsOnlyAggregationCallType(windowGroup.aggCalls);
+ // Has rank based aggregation call kind (e.g. ROW_NUMBER, RANK, DENSE_RANK)
+ boolean hasRankBasedAgg = hasRankBasedAgg(windowGroup.aggCalls);
+
+ // FOLLOWING lower bound or PRECEDING upper bound is not allowed, and
won't reach here
Review Comment:
`UNBOUNDED PRECEDING` is not allowed for upper frame boundary and `UNBOUNDED
FOLLOWING` is not allowed for lower frame boundary. However, `n PRECEDING` is
allowed for upper frame boundary and `n FOLLOWING` is allowed for lower frame
boundary (not at the same time though). This behavior is similar in both
Calcite and Postgres.
--
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]