tez엔진으로 쿼리를 돌릴때 dynamic partition 해서 insert 할때 나오는 버그이다.
파티셔닝 필드를 동적으로 지정하면 문제가 된다. 이 버그를 회피하는 방법은 파티션 필드의 값을 상수로 지정해주면된다.
물론, 이렇게 하면 여러데이터가 섞여있다면 수작업이 걸릴텐데.
스케쥴형태로 배치돌리는 구조라면 큰 문제는 안될듯...
Status: Running (Executing on YARN cluster with App id application_1465540766236_4158)
--------------------------------------------------------------------------------
VERTICES STATUS TOTAL COMPLETED RUNNING PENDING FAILED KILLED
--------------------------------------------------------------------------------
Map 1 .......... SUCCEEDED 160 160 0 0 0 0
Map 3 SUCCEEDED 0 0 0 0 0 0
Map 4 SUCCEEDED 0 0 0 0 0 0
--------------------------------------------------------------------------------
VERTICES: 03/03 [==========================>>] 100% ELAPSED TIME: 8.25 s
--------------------------------------------------------------------------------
Loading data to table temp.speed_test partition (base_dt=null, base_tm=null)
Failed with exception MetaException(message:Invalid partition key & values; keys [base_dt, base_tm, ], values [])
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask
[문제의 쿼리 패턴]
insert overwrite table temp.speed_test partition(base_dt, base_tm)
SELECT
....
, base_dt
, base_tm
FROM
.....
[버그를 해결하려면?]
insert overwrite table temp.speed_test partition(base_dt='20160614', base_tm='16')
SELECT
....
, base_dt
, base_tm
FROM
.....
ymd = '20160614' and hh24=16