How to load a text file into a Hive table stored as sequence files

前端 未结 3 1592
忘掉有多难
忘掉有多难 2021-01-30 11:11

I have a hive table stored as a sequencefile.

I need to load a text file into this table. How do I load the data into this table?

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-30 11:52

    The simple way is to create table as textfile and move the file to the appropriate location

    CREATE EXTERNAL TABLE mytable(col1 string, col2 string)
    row format delimited fields terminated by '|' stored as textfile;

    Copy the file to the HDFS Location where table is created.
    Hope this helps!!!

提交回复
热议问题