본문 바로가기

SQL/hive

[hive] partition column rename

hive에서 실행할것. impala에서 하면 실행안됨

ALTER TABLE tmp.table PARTITION (base_dt='20200601') RENAME TO PARTITION (base_dt='2020-06-01')

 

hadoop distcp /old_dir/base_dt=20200601/* /new_dir/base_dt=2020-06-01/filename

 

파티션 컬럼 경로 변경

ALTER TABLE tmp.table PARTITION (base_dt='2020-06-01') SET LOCATION '/newdir/base_dt=2020-06-01'