flink sql lateral table问题

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

flink sql lateral table问题

赵帅
关于行转列问题,请教一下
SELECT
    alert_id,
    organization_id
FROM  (
    SELECT alert_id, org_ids FROM db_ods_hive.ods_alert_content_in_hive WHERE cd_date = '${date}'
)
LEFT JOIN LATERAL TABLE(ALERT_ORGANIZATION_IDS_TO_ROWS(org_ids, ',')) AS T(organization_id) ON TRUE
WHERE
    organization_id IS NOT NULL
AND organization_id > 0
上面select语句没有问题
INSERT INTO db_ods_hive.ods_alert_organization_relation_in_hive PARTITION(cd_date ='${date}')
SELECT
    alert_id,
    organization_id
FROM  (
    SELECT alert_id, org_ids FROM db_ods_hive.ods_alert_content_in_hive WHERE cd_date = '${date}'
)
LEFT JOIN LATERAL TABLE(ALERT_ORGANIZATION_IDS_TO_ROWS(org_ids, ',')) AS T(organization_id) ON TRUE
WHERE
    organization_id IS NOT NULL
AND organization_id > 0当添加insert语句后,报org_ids字段找不到