Hive - Create Table statement with 'select query' and 'fields terminated by' commands
Hive - Create Table statement with 'select query' and 'fields terminated by' commands I want to create a table in Hive using a select statement which takes a subset of a data from another table. I used the following query to do so : create table sample_db.out_table as select * from sample_db.in_table where country = 'Canada'; When I looked into the HDFS location of this table, there are no field separators. But I need to create a table with filtered data from another table along with a field separator. For example I am trying to do something like : create table sample_db.out_table as select * from sample_db.in_table where country = 'Canada' ROW FORMAT SERDE FIELDS TERMINATED BY '|'; This is not working though. I know the alternate way is to create a table structure with field names and the "FIELDS TERMINATED BY '|'" command and then load the data. But is there any other way to combine the two into a single query that enables m...