limit() 函数
limit()
从每个输入表中指定的 offset
之后返回前 n
行。
如果输入表拥有的行数小于 offset + n
,则 limit()
返回 offset 之后的所有行。
函数类型签名
(<-tables: stream[A], n: int, ?offset: int) => stream[A]
有关更多信息,请参阅 函数类型签名。
参数
n
(必需)要返回的最大行数。
offset
在限制为 n
之前,每个表要跳过的行数。默认为 0
。
tables
输入数据。默认为管道传递的数据 (<-
)。
示例
将结果限制为每个表中的前三行
import "sampledata"
sampledata.int()
|> limit(n: 3)
将结果限制为每个输入表中前两行之后的头三行
import "sampledata"
sampledata.int()
|> limit(n: 3, offset: 2)
此页是否对您有帮助?
感谢您的反馈!