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导入

posted @ 2020-08-31 16:09  远去的列车  阅读(941)  评论(0编辑  收藏  举报