1.报错:
Error while compiling statement: FAILED: SemanticException [Error 10007]: Ambiguous column reference creationtime in bcpt
2. sql如下:
insert overwrite table z_w_clean.di_tets_e_type
SELECT cont_pr_code,
plurt_code,
elec_e_code,
cont_price_name,
pre,
creadate,
ste,
creationtime,
ornizeid,
cont_free,
is_frlevy,
bace_limit,
creationtime,
creorid,
null,
liicatiotime,
lasmoerid,
null
FROM (SELECT contce_code,
plusort_coe,
eleype_code,
contrice_name,
pice,
cte_date,
sate,
fr_type,
orgzeid,
con_free,
iee_levy,
ballimit,
From_unixtime(Unix_timestamp(creationtime)) AS creationtime,
crearid,
null,
From_unixtime(Unix_timestamp(lastmontime)) AS lastationtime,
lastmoid,
null,
Row_number() OVER(partition BY contece_code ORDER BY ontime DESC) AS num
FROM s_wter.buients_prce_pe) bbb
WHERE bbb.num = 1;
3.报错原因:有重复定义的列: creationtime , 改名解决 。