limit() 函数
limit()
函数从每个输入表中返回指定 offset
之后的**前** n
行。
如果输入表的行数少于 offset + n
行,则 limit()
函数返回偏移量之后的所有行。
函数类型签名
(<-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)
此页内容是否对您有帮助?
感谢您的反馈!