通過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導入