experimental.unpivot() 函数
experimental.unpivot()
可能会随时更改。
experimental.unpivot()
使用所有不在分组键中的列(_time
除外)创建 _field
和 _value
列对。_field
列包含原始列标签,_value
列包含原始列值。
输出流保留输入流的分组键和所有分组键列。_field
被添加到输出分组键中。
函数类型签名
(<-tables: stream[{A with _time: time}], ?otherColumns: [string]) => stream[{B with _value: C, _field: string}] where A: Record, B: Record
有关更多信息,请参阅函数类型签名。
参数
tables
输入数据。默认为管道转发数据 (<-
)。
otherColumns
不在分组键中但也不是字段列的列名列表。默认为 ["_time"]
。
示例
将数据透视为 _field 和 _value 列
import "experimental"
data
|> experimental.unpivot()
此页面是否对您有帮助?
感谢您的反馈!