Cloudflare Pipelines のスカラー関数実装は Apache DataFusion ↗(Arroyo ↗ 経由)を基にしており、このドキュメントは DataFusion の関数リファレンスから派生しています。
値を特定の Arrow データ型にキャストします。
arrow_cast(expression, datatype)引数
- expression: キャストする式。 定数、列、関数、および算術演算子または文字列演算子の任意の組み合わせを使えます。
- datatype: キャスト先の Arrow データ型 ↗ 名を、文字列で指定します。形式は [
arrow_typeof] が返すものと同じです。
例
> select arrow_cast(-5, 'Int8') as a,
arrow_cast('foo', 'Dictionary(Int32, Utf8)') as b,
arrow_cast('bar', 'LargeUtf8') as c,
arrow_cast('2023-01-02T12:53:02', 'Timestamp(Microsecond, Some("+08:00"))') as d
;
+----+-----+-----+---------------------------+
| a | b | c | d |
+----+-----+-----+---------------------------+
| -5 | foo | bar | 2023-01-02T12:53:02+08:00 |
+----+-----+-----+---------------------------+
1 row in set. Query took 0.001 seconds.式の基になる Arrow データ型 ↗ の名前を返します。
arrow_typeof(expression)引数
- expression: 評価する式。 定数、列、関数、および算術演算子または文字列演算子の任意の組み合わせを使えます。
例
> select arrow_typeof('foo'), arrow_typeof(1);
+---------------------------+------------------------+
| arrow_typeof(Utf8("foo")) | arrow_typeof(Int64(1)) |
+---------------------------+------------------------+
| Utf8 | Int64 |
+---------------------------+------------------------+
1 row in set. Query took 0.001 seconds.