You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/07/25 07:10:34 UTC

[GitHub] [flink] luoyuxia commented on a diff in pull request #20347: [FLINK-27620][sql] Flink SQL supports PERCENT_RANK function

luoyuxia commented on code in PR #20347:
URL: https://github.com/apache/flink/pull/20347#discussion_r928537444


##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/utils/AggFunctionFactory.scala:
##########
@@ -105,6 +105,13 @@ class AggFunctionFactory(
           throw new TableException("CUME_DIST Function is not supported in stream mode.")
         }
 
+      case a: SqlRankFunction if a.getKind == SqlKind.PERCENT_RANK =>
+        if (isBounded) {
+          createPercentRankAggFunction(argTypes)
+        } else {
+          throw new TableException("PERCENT_RANK Function is not supported in batch mode.")

Review Comment:
   Yes,  `PERCENT_RANK` need to know the size of window partition. But in stream mode, we can't know the size as the data is unbounded.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org