hive的路径已经加载到/etc/profile 中
当前启动hive的路径是/home/hadoop/app/hive/hive0.8.1*
测试数据的地址为:/home/hadoop/app/testData/book.txt'
hive> load data local inpath '/home/hadoop/app/testData/book.txt' overwrite into table book;
FAILED: Error in semantic analysis: Line 1:23 Invalid path ''/home/hadoop/app/testData/book.txt'': No files matching path file:/home/hadoop/app/testData/book.txt
然后,我将测试数据cp到当前登录的hive目录下,
结果居然ok了
hive> load data local inpath './example/book.txt' overwrite into table book;Copying data from file:/home/hadoop/app/hive/hive-0.8.1/example/book.txt
Copying file: file:/home/hadoop/app/hive/hive-0.8.1/example/book.txt
Loading data to table default.book
Deleted hdfs://49.123.83.1:9000/user/hive/warehouse/book
OK
Time taken: 0.254 seconds
hive>
当然也可以直接从hdfs上copy
比如:load data inpath 'hdfs://hadoop-node1:9000/someTest/book.txt'
这样貌似是mv,因为当我再次去这个目录下check 的时候,发现book.txt已经没了