Skip to content

Commit 2738c02

Browse files
huwhMartijnVisser
authored andcommitted
[FLINK-26395][docs] Correct the wrong description of SQL function: RAND_INTEGER. This fixes apache#19104
1 parent 9da51e1 commit 2738c02

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

docs/data/sql_functions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@ arithmetic:
221221
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.
222222
- sql: RAND_INTEGER(INT)
223223
table: randInteger(INT)
224-
description: Returns a pseudorandom double value in the range [0.0, INT)
224+
description: Returns a pseudorandom integer value in the range [0, INT)
225225
- sql: RAND_INTEGER(INT1, INT2)
226226
table: randInteger(INT1, INT2)
227-
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.
227+
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.
228228
- sql: UUID()
229229
table: uuid()
230230
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.

docs/data/sql_functions_zh.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,11 @@ arithmetic:
271271
如果两个 RAND 函数具有相同的初始种子,它们将返回相同的数字序列。
272272
- sql: RAND_INTEGER(INT)
273273
table: randInteger(INT)
274-
description: 返回 [0.0, INT) 范围内的伪随机双精度值
274+
description: 返回 [0, INT) 范围内的伪随机整数
275275
- sql: RAND_INTEGER(INT1, INT2)
276276
table: randInteger(INT1, INT2)
277277
description: |
278-
返回范围为 [0.0, INT2) 的伪随机双精度值,初始种子为 INT1。
278+
返回范围为 [0, INT2) 的伪随机整数,初始种子为 INT1。
279279
如果两个 RAND_INTGER 函数具有相同的初始种子和边界,它们将返回相同的数字序列。
280280
- sql: UUID()
281281
table: uuid()

flink-python/pyflink/table/expressions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def rand(seed: Union[int, Expression[int]] = None) -> Expression[float]:
438438
def rand_integer(bound: Union[int, Expression[int]],
439439
seed: Union[int, Expression[int]] = None) -> Expression:
440440
"""
441-
Returns a pseudorandom integer value between 0.0 (inclusive) and the specified value
441+
Returns a pseudorandom integer value between 0 (inclusive) and the specified value
442442
(exclusive) with a initial seed if specified. Two rand_integer() functions will return
443443
identical sequences of numbers if they have same initial seed and same bound.
444444
"""

flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/Expressions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,15 +444,15 @@ public static ApiExpression rand(Object seed) {
444444
}
445445

446446
/**
447-
* Returns a pseudorandom integer value between 0.0 (inclusive) and the specified value
447+
* Returns a pseudorandom integer value between 0 (inclusive) and the specified value
448448
* (exclusive).
449449
*/
450450
public static ApiExpression randInteger(Object bound) {
451451
return apiCall(BuiltInFunctionDefinitions.RAND_INTEGER, objectToExpression(bound));
452452
}
453453

454454
/**
455-
* Returns a pseudorandom integer value between 0.0 (inclusive) and the specified value
455+
* Returns a pseudorandom integer value between 0 (inclusive) and the specified value
456456
* (exclusive) with a initial seed. Two randInteger() functions will return identical sequences
457457
* of numbers if they have same initial seed and same bound.
458458
*/

0 commit comments

Comments
 (0)