【发布时间】:2019-07-29 14:25:43
【问题描述】:
我想在一个更复杂的例子中使用this 简单主题。这是我的尝试:
SELECT maxxx.COD_ENTREP as ID_ENTITE,
maxxx.COD_ENTREP_ASSU as ID_ENTITE_GARANTE,
maxxx.ID_NOTIFICATION as ID_NOTIFICATION,
maxxx.OBJET_METIER as OBJET_METIER,
REF_EXT_OBJET_METIER,
case when maxxx.typ_mvt="S" then 1 else 0 end AS TOP_SUPP,
case when maxxx.typ_mvt = "S" then to_date(substr(maxxx.dt_capt, 1, 11)) else null end AS DT_SUPP,
minnn.typ_mvt as MIN_MVT,
maxxx.typ_mvt as MAX_MVT,
case when minnn.typ_mvt = 'C' then 'C' else 'M' end as TYP_MVT
FROM
(select s.id_notification, s.dt_capt, s.typ_mvt from ${use_database}.pz_send_notification as s
join
(select id_notification, min(dt_capt) as dtmin from ${use_database}.pz_send_notification group by id_notification) as minn
on s.id_notification=minn.id_notification and s.dt_capt=minn.dtmin) as minnn
join
(select s.id_notification, s.dt_capt, s.typ_mvt, s.cod_entrep, s.cod_entrep_assu, s.objet_metier from ${use_database}.pz_send_notification as s
join
(select id_notification, max(dt_capt) as dtmax from ${use_database}.pz_send_notification group by id_notification) as maxx
on s.id_notification=maxx.id_notification and s.dt_capt=maxx.dtmax) as maxxx
on minnn.id_notification=maxxx.id_notification
lateral view explode(split(maxxx.OBJET_METIER, ";")) maxxx.OBJET_METIER as ee;
我想在使用多个连接创建的表上应用拆分功能。
但我一直有这个错误:
Error while compiling statement: FAILED: ParseException line 28:0 missing EOF at 'lateral' near 'id_notification'
编辑
这是查询的结果没有最后一行(侧视图爆炸):
我想要的是一个有 4 行的表格。前三个是 ref_ext_objet_metier_column 使用 split on ";" 复制的结果。
【问题讨论】:
-
您能向我们展示表格数据和预期结果吗?
-
我刚刚编辑了我的问题