Inserting Data into Hive Table

后端 未结 11 1184
失恋的感觉
失恋的感觉 2020-12-14 17:01

I am new to hive. I have successfully setup a single node hadoop cluster for development purpose and on top of it, I have installed hive and pig.

I created a dummy t

11条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-14 17:19

    What ever data you have inserted into one text file or log file that can put on one path in hdfs and then write a query as follows in hive

      hive>load data inpath<> into table <>;
    

    EXAMPLE:

    hive>create table foo (id int, name string)
    row format delimited
    fields terminated by '\t' or '|'or ','
    stored as text file;
    table created..
        DATA INSERTION::
        hive>load data inpath '/home/hive/foodata.log' into table foo;
    

提交回复
热议问题