更新时间:2022-04-28 GMT+08:00

表值函数

表值函数可以将一行转多行,一列转为多列,仅支持在JOIN LATERAL TABLE中使用。

表1 表值函数表

函数

返回值类型

描述

split_cursor(value, delimiter)

cursor

将字符串value按delimiter分隔为多行字符串。

示例

输入一条记录("student1", "student2, student3"),输出两条记录("student1", "student2") 和 ("student1", "student3") 。

create source stream s1(attr1 string, attr2 string) with (......);
insert into s2 select  attr1, b1 from s1 left join lateral table(split_cursor(attr2, ',')) as T(b1) on true;