본문 바로가기

SQL/hive

[hive] table rename , change location

테이블명 변경

alter table tmp.oldname rename to tmp.newname

 

경로 변경

터미널에서 파일 복사

hadoop distcp hdfs://old_dir/* hdfs://new_dir

쿼리

alter table tmp.newname set location 'hdfs://new_dir'