Skip to content

非公式 / UnofficialCloudflare, Inc. 非提携。アカウント情報は入力しないでください。Not affiliated with Cloudflare, Inc. Do not enter Cloudflare credentials here.Official docsこのサイトについてプライバシー

struct 関数

最終更新 Markdown で表示Agent セットアップ

Cloudflare Pipelines のスカラー関数実装は Apache DataFusion ↗(Arroyo ↗ 経由)を基にしており、このドキュメントは DataFusion の関数リファレンスから派生しています。

struct

指定した入力式を使い、Arrow の struct を返します。 戻り値の struct のフィールドは cN の命名規則を使います。 例: c0、c1、c2 など。

struct(expression1[, ..., expression_n])

たとえば、次のクエリは列 a と b を、フィールド c0 と c1 を持つ struct 型の 1 列に変換します。

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: 出力 struct に含める式です。 定数、列、関数、および算術演算子や文字列演算子の組み合わせを使えます。

役に立ちましたか?