Hive JDBC执行load时无法从本地加载数据


通过hive-jdcv连接hive server,在应用服务端执行以下命令,报错:Hiver Server节点上找不到data.txt

load data local inpath '/home/dw_hbkas/przhang/data.txt' overwrite into table ind01acom

原因如下:

When using the JDBC driver, the command executes on the HiveServer2 side. The file is evaluated to locally exist on the server, which is not true in your case (it exists on the local client program machine).
Try instead to load the file to HDFS first, and use a HDFS URI in the LOAD DATA statement to make the server find it.

通过JDBC使用load命令时,hive会从hive server节点上找文件,应用服务跟hive server不是一个节点。

解决方法:
load之前文件上传到hdfs上,从hdfs导入


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM