join.time() 函数
join.time()
仅在 _time
列上将两个表流连接在一起。
此函数调用 join.tables()
,并将 on
参数设置为 (l, r) => l._time == r._time
。
函数类型签名
(
<-left: stream[{A with _time: B}],
as: (l: {A with _time: B}, r: {C with _time: D}) => E,
right: stream[{C with _time: D}],
?method: string,
) => stream[E] where B: Equatable, D: Equatable, E: Record
有关更多信息,请参阅 函数类型签名。
参数
left
左输入流。 默认为管道转发数据 (<-)。
right
(必需) 右输入流。
as
(必需) 接受左记录和右记录(分别为 l
和 r
),并返回记录的函数。 返回的记录包含在最终输出中。
method
指定连接方法的字符串。 默认为 inner
。
支持的方法
- inner
- left
- right
- full
示例
按时间戳连接两个表
import "sampledata"
import "join"
ints = sampledata.int()
strings = sampledata.string()
join.time(left: ints, right: strings, as: (l, r) => ({l with label: r._value}))
此页是否对您有帮助?
感谢您的反馈!