给出一个Hive表
create table movie_1(id int, movie_title string, actor string, gender string)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ';'
vi movies.txt
1;hero;john penn;male
2;hero;maggie mcguirre;female
3;lost;peter jones;male
假设有一个新表movie_2
,但字段类型为STRUCT
:
create table movie_2(id int, movie_title string, STRUCT <actor:string, gender:string>)
如何从现有表movie_2
创建新表movie_1
,即从movies_1
选择插入新表movies_2?