【发布时间】:2017-01-23 11:33:35
【问题描述】:
给定一个 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_1 中创建一个新表movie_2,即从movies_1 中选择插入新表movies_2?
【问题讨论】: