raminqaf commented on code in PR #29864: URL: https://github.com/apache/flink/pull/29864#discussion_r4601054562
########## docs/data/functions/window/rank.yml: ########## @@ -0,0 +1,80 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License + +name: RANK +summary: Returns the rank of each row within its partition, with gaps after ties. + +syntax: + sql: RANK() OVER ([PARTITION BY expression [, ...]] ORDER BY expression [ASC | DESC] [, ...]) + +returns: + description: One plus the number of rows that come before the current row in its partition, by the `ORDER BY` of the window. Rows with equal `ORDER BY` values, called peers, get the same rank, and the next rank skips the numbers they used, such as `1, 2, 2, 4`. + type: "`BIGINT NOT NULL`." + +notes: + - The window needs an `ORDER BY` and can't have a frame clause, such as `ROWS BETWEEN 1 PRECEDING AND CURRENT ROW`. + - Not supported in streaming mode. Use `ROW_NUMBER` instead. Review Comment: Fixed, RANK runs in streaming mode as an OVER column, and only Top-N isn't supported. The page also describes the streaming ties now. ########## docs/data/functions/window/dense_rank.yml: ########## @@ -0,0 +1,65 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License + +name: DENSE_RANK +summary: Returns the rank of each row within its partition, without gaps after ties. + +syntax: + sql: DENSE_RANK() OVER ([PARTITION BY expression [, ...]] ORDER BY expression [ASC | DESC] [, ...]) + +returns: + description: One plus the number of distinct `ORDER BY` values that come before the current row in its partition. Rows with equal `ORDER BY` values, called peers, get the same rank, and the next rank follows without a gap, such as `1, 2, 2, 3`. + type: "`BIGINT NOT NULL`." + +notes: + - The window needs an `ORDER BY` and can't have a frame clause, such as `ROWS BETWEEN 1 PRECEDING AND CURRENT ROW`. + - Not supported in streaming mode. Use `ROW_NUMBER` instead. Review Comment: fixed -- 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]
