Hadoop/Hive : Loading data from .csv on a local machine

后端 未结 6 1384
不知归路
不知归路 2020-12-24 05:20

As this is coming from a newbie...

I had Hadoop and Hive set up for me, so I can run Hive queries on my computer accessing data on AWS cluster. Can I run Hive querie

6条回答
  •  醉话见心
    2020-12-24 05:53

    For csv file formate data will be in below format

    "column1", "column2","column3","column4"
    

    And if we will use field terminated by ',' then each column will get values like below.

    "column1"    "column2"     "column3"     "column4"
    

    also if any of the column value has comma as value then it will not work at all .

    So the correct way to create a table would be by using OpenCSVSerde

    create table tableName (column1 datatype, column2 datatype , column3 datatype , column4 datatype)
    ROW FORMAT SERDE 
    'org.apache.hadoop.hive.serde2.OpenCSVSerde' 
    STORED AS TEXTFILE ;
    

提交回复
热议问题