すべてのプロダクト
Search
ドキュメントセンター

MaxCompute:INLINE

最終更新日:Jan 17, 2025

特定のstruct配列を展開します。 各配列要素は行に対応し、各struct要素は各行の列に対応する。

構文

inline(array<struct<f1:T1, f2:T2[, ...]>>)

パラメーター

f1:T1およびf2:T2: 必須。 すべてのデータ型がサポートされています。 f1およびf2はメンバ変数を指定し、T1f1の値を指定し、T2f2の値を指定する。

戻り値

struct配列の展開データが返されます。

t_tableテーブルは、t_struct (STRUCT<user_id:BIGINT,user_name:STRING,married:STRING,weight:DOUBLE>) フィールドを含む。 テーブル内のデータ:

+----------+
| t_struct |
+----------+
| {user_id:10001, user_name:LiLei, married:N, weight:63.5} |
| {user_id:10002, user_name:HanMeiMei, married:Y, weight:43.5} |
+----------+

例:

-- Expand the t_struct column. 
select inline(array(t_struct)) from t_table;
-- The following result is returned: 
+------------+-----------+---------+------------+
| user_id    | user_name | married | weight     |
+------------+-----------+---------+------------+
| 10001      | LiLei     | N       | 63.5       |
| 10002      | HanMeiMei | Y       | 43.5       |
+------------+-----------+---------+------------+

関連関数

INLINEは複雑なタイプの関数です。 ARRAY、MAP、STRUCT、JSONなどの複雑なデータ型のデータを処理するために使用される関数の詳細については、複合型関数.