Create hive table using “as select” or “like” and also specify delimiter

后端 未结 3 1191
粉色の甜心
粉色の甜心 2020-12-14 00:21

Is it possible to do a

create table as select

using

row format delimited fields termi         


        
3条回答
  •  鱼传尺愫
    2020-12-14 00:58

    Create Table as select (CTAS) is possible in Hive.

    You can try out below command:

    CREATE TABLE new_test 
        row format delimited 
        fields terminated by '|' 
        STORED AS RCFile 
    AS select * from source where col=1
    
    1. Target cannot be partitioned table.
    2. Target cannot be external table.
    3. It copies the structure as well as the data

    Create table like is also possible in Hive.

    1. It just copies the source table definition.

提交回复
热议问题