Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Returns a table of values within a specified range.
Syntax
range(end)
range(start, end [, step [, numParts] ] )
Arguments
start: An optionalBIGINTliteral defaulted to 0, marking the first value generated.end: ABIGINTliteral marking endpoint (exclusive) of the number generation.step: An optionalBIGINTliteral defaulted to 1, specifying the increment used when generating values.numParts: An optionalINTEGERliteral specifying how the production of rows is spread across partitions.
Returns
A table with a single BIGINT column named id.
Examples
> SELECT spark_partition_id(), t.* FROM range(5) AS t;
3 0
6 1
9 2
12 3
15 4
> SELECT * FROM range(-3, 0);
-3
-2
-1
> SELECT spark_partition_id(), t.* FROM range(0, -5, -1, 2) AS t;
0 0
0 -1
1 -2
1 -3
1 -4