Insert data into hive table

前端 未结 6 1160
梦毁少年i
梦毁少年i 2021-02-04 06:22

Using a Cygwin distribution, I\'ve installed Hadoop 0.20.3 and Hive 0.11.0.

First of all, I don\'t understand how to use the Hive CLI:

hive> show tabl         


        
6条回答
  •  走了就别回头了
    2021-02-04 07:13

    If table is without partition then code will be,

    Insert into table table_name select col_a,col_b,col_c from another_table(source table)

    --here any condition can be applied such as limit, group by, order by etc...

    If table is with partitions then code will be,

    set hive.exec.dynamic.partition=true;
    set hive.exec.dynamic.partition.mode=nonstrict;

    insert into table table_name partition(partition_col1, paritition_col2) select col_a,col_b,col_c,partition_col1,partition_col2 from another_table(source table)

    --here any condition can be applied such as limit, group by, order by etc...

提交回复
热议问题