Is it possible to do a
create table <mytable> as select <query statement>
using
row format delimited fields terminated by '|';
or to do a
create table <mytable> like <other_table> row format delimited fields terminated by '|';
The Language Manual seems to indicate not.. but something tickles me I had achieved this in the past.
Let's say we have an external table called
employee
To create a
person
table likeemployee
CREATE TABLE person LIKE employee;
To create a
person
external table likeemployee
CREATE TABLE person LIKE employee LOCATION 'maprfs:/user/hadoop/data/person';
then use
DESC person;
to see the newly created table schema.You can try out below command: