Is it possible to import data into Hive table without copying the data

后端 未结 4 1081
花落未央
花落未央 2021-02-14 00:49

I have log files stored as text in HDFS. When I load the log files into a Hive table, all the files are copied.

Can I avoid having all my text data stored twice?

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-14 01:15

    I can say, instead of copying data by your java application directly to HDFS, have those file in local file system, and import them into HDFS via hive using following command.

    LOAD DATA LOCAL INPATH '/your/local/filesystem/file.csv' INTO TABLE `sandbox.test` PARTITION (day='20130221')
    

    Notice the LOCAL

提交回复
热议问题