Cloudflare Pipelines 标量函数实现基于 Apache DataFusion ↗(通过 Arroyo ↗),本文档源自 DataFusion 函数参考。
使用指定的输入表达式返回 Arrow 结构体。
返回结构体中的字段使用 cN 命名约定。
例如:c0、c1、c2 等。
struct(expression1[, ..., expression_n])例如,此查询将两列 a 和 b 转换为具有字段 c0 和 c1 的单个结构体类型列:
select * from t;
+---+---+
| a | b |
+---+---+
| 1 | 2 |
| 3 | 4 |
+---+---+
select struct(a, b) from t;
+-----------------+
| struct(t.a,t.b) |
+-----------------+
| {c0: 1, c1: 2} |
| {c0: 3, c1: 4} |
+-----------------+- expression_n: 要包含在输出结构体中的表达式。 可以是常量、列或函数,以及算术或字符串运算符的任何组合。