我想將分區值作爲參數傳遞。傳遞給分區的參數在配置單元中不起作用
SET runmdt = date_sub(current_date,5);
以下查詢工作正常。
SELECT
cal_id,caller_name,location
from
amobe_tbl a
WHERE a.create_dt IN
(select DISTINCT create_dt from mt_call
WHERE create_dt between date_sub(current_date,20) and current_date)
and a.create_dt=${hiveconf:runmdt};
當插入分區表它不工作。
SET runmdt = date_sub(current_date,5);
INSERT OVERWRITE TABLE amobe_tbl PARTITION (create_dt=${hiveconf:runmdt})
SELECT
cal_id,caller_name,location
from
amobe_tbl a
WHERE a.create_dt IN
(select DISTINCT create_dt from mt_call
WHERE create_dt between date_sub(current_date,20) and current_date)
and a.create_dt=${hiveconf:runmdt};
失敗:ParseException的線1:92不能在不斷 create_dt識別輸入的附近 'DATE_SUB' '(' 'CURRENT_DATE' 是日期型數據
請幫我在
感謝。提前。
你有你的答案,但在任何情況下,WHERE子句是沒有意義的('WHERE a.create_dt IN(...)和。 create_dt = $ {hiveconf:runmdt}') –