[Hive] Creating Table from Another Table
Creating Table from Another Table
-- target columns can be different from the original source table
create table if not exists from_table2 (
col1 int,
col3 string,
col4 int
);s
stored as textfile;
-- hive table로부터 load 하므로 기존 rows terminated, lines terminated 설정 필요 없음
-- load data
insert into table from_table2 select col1, col3, col4 from table2; -- 추가할 경우
insert overwrite table from_table2 select col1, col3, col4 from table2; -- 덮어쓸 경우