我正在尝试在HDP沙盒上加载sample.log
文件
我最初的努力
LOAD DATA LOCAL INPATH 'sample.log' OVERWRITE INTO TABLE logs;
似乎路径不匹配
Error: Error while compiling statement: FAILED: SemanticException Line 1:23 Invalid path ''sample.log'': No files matching path file:/home/hive/sample.log (state=42000,code=40000)
我注销,移至/ root,然后输入hive
0: jdbc:hive2://sandbox-hdp.hortonworks.com:2> LOAD DATA LOCAL INPATH '/root/Hadoop_Spark_Fundamentals_Code_Notes-V3.0/Lesson-6/Lesson-6.2_Hive/sample.log' OVERWRITE INTO TABLE logs;
全路径也不起作用。
Error: Error while compiling statement: FAILED: SemanticException Line 1:23 Invalid path ''/root/Hadoop_Spark_Fundamentals_Code_Notes-V3.0/Lesson-6/Lesson-6.2_Hive/sample.log'': No files matching path file:/root/Hadoop_Spark_Fundamentals_Code_Notes-V3.0/Lesson-6/Lesson-6.2_Hive/sample.log (state=42000,code=40000)
在我看来,它混淆了/ root和/ home / hive。
如何设置正确的路径?
答案 0 :(得分:1)
您的语句正在由用户“ hive”执行。确保本地文件具有允许“配置单元”对其进行读取访问的权限。