You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ma...@apache.org on 2022/03/27 12:22:23 UTC
[flink] branch master updated: [FLINK-26395][docs] Correct the wrong description of SQL function: RAND_INTEGER. This fixes #19104
This is an automated email from the ASF dual-hosted git repository.
martijnvisser pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new 2738c02 [FLINK-26395][docs] Correct the wrong description of SQL function: RAND_INTEGER. This fixes #19104
2738c02 is described below
commit 2738c02db7100ff172b4ca7bd4c294419fe7ba7c
Author: huweihua <hu...@gmail.com>
AuthorDate: Wed Mar 16 09:49:36 2022 +0800
[FLINK-26395][docs] Correct the wrong description of SQL function: RAND_INTEGER. This fixes #19104
---
docs/data/sql_functions.yml | 4 ++--
docs/data/sql_functions_zh.yml | 4 ++--
flink-python/pyflink/table/expressions.py | 2 +-
.../src/main/java/org/apache/flink/table/api/Expressions.java | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/docs/data/sql_functions.yml b/docs/data/sql_functions.yml
index 80c4edf..8c01be4 100644
--- a/docs/data/sql_functions.yml
+++ b/docs/data/sql_functions.yml
@@ -221,10 +221,10 @@ arithmetic:
description: Returns a pseudorandom double value in the range [0.0, 1.0) with an initial seed integer. Two RAND functions will return identical sequences of numbers if they have the same initial seed.
- sql: RAND_INTEGER(INT)
table: randInteger(INT)
- description: Returns a pseudorandom double value in the range [0.0, INT)
+ description: Returns a pseudorandom integer value in the range [0, INT)
- sql: RAND_INTEGER(INT1, INT2)
table: randInteger(INT1, INT2)
- description: Returns a pseudorandom double value in the range [0.0, INT2) with an initial seed INT1. Two RAND_INTGER functions will return idential sequences of numbers if they have the same initial seed and bound.
+ description: Returns a pseudorandom integer value in the range [0, INT2) with an initial seed INT1. Two RAND_INTGER functions will return idential sequences of numbers if they have the same initial seed and bound.
- sql: UUID()
table: uuid()
description: Returns an UUID (Universally Unique Identifier) string (e.g., "3d3c68f7-f608-473f-b60c-b0c44ad4cc4e") according to RFC 4122 type 4 (pseudo randomly generated) UUID. The UUID is generated using a cryptographically strong pseudo random number generator.
diff --git a/docs/data/sql_functions_zh.yml b/docs/data/sql_functions_zh.yml
index ae8670f..e5e22b6 100644
--- a/docs/data/sql_functions_zh.yml
+++ b/docs/data/sql_functions_zh.yml
@@ -271,11 +271,11 @@ arithmetic:
如果两个 RAND 函数具有相同的初始种子,它们将返回相同的数字序列。
- sql: RAND_INTEGER(INT)
table: randInteger(INT)
- description: 返回 [0.0, INT) 范围内的伪随机双精度值。
+ description: 返回 [0, INT) 范围内的伪随机整数。
- sql: RAND_INTEGER(INT1, INT2)
table: randInteger(INT1, INT2)
description: |
- 返回范围为 [0.0, INT2) 的伪随机双精度值,初始种子为 INT1。
+ 返回范围为 [0, INT2) 的伪随机整数,初始种子为 INT1。
如果两个 RAND_INTGER 函数具有相同的初始种子和边界,它们将返回相同的数字序列。
- sql: UUID()
table: uuid()
diff --git a/flink-python/pyflink/table/expressions.py b/flink-python/pyflink/table/expressions.py
index 2467db3..d870f82 100644
--- a/flink-python/pyflink/table/expressions.py
+++ b/flink-python/pyflink/table/expressions.py
@@ -438,7 +438,7 @@ def rand(seed: Union[int, Expression[int]] = None) -> Expression[float]:
def rand_integer(bound: Union[int, Expression[int]],
seed: Union[int, Expression[int]] = None) -> Expression:
"""
- Returns a pseudorandom integer value between 0.0 (inclusive) and the specified value
+ Returns a pseudorandom integer value between 0 (inclusive) and the specified value
(exclusive) with a initial seed if specified. Two rand_integer() functions will return
identical sequences of numbers if they have same initial seed and same bound.
"""
diff --git a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/Expressions.java b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/Expressions.java
index 2096f29..b102fbc 100644
--- a/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/Expressions.java
+++ b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/Expressions.java
@@ -444,7 +444,7 @@ public final class Expressions {
}
/**
- * Returns a pseudorandom integer value between 0.0 (inclusive) and the specified value
+ * Returns a pseudorandom integer value between 0 (inclusive) and the specified value
* (exclusive).
*/
public static ApiExpression randInteger(Object bound) {
@@ -452,7 +452,7 @@ public final class Expressions {
}
/**
- * Returns a pseudorandom integer value between 0.0 (inclusive) and the specified value
+ * Returns a pseudorandom integer value between 0 (inclusive) and the specified value
* (exclusive) with a initial seed. Two randInteger() functions will return identical sequences
* of numbers if they have same initial seed and same bound.
*/