We have enterprise hadoop cluster installed on linux servers in our organisation. I am trying to insert csv file into one of our hive tables. I have csv file in my local windows machine. I am using python and using jaydebeapi package to connect to hive through jdbc. While I am using "LOAD DATA LOCAL..." command in code, it is throwing error related to paths not legal file path. How to resolve this issue? Below is the error I am getting.
Note: I am not going to use hdfs commands manually to copy csv file to hdfs and then load data. I want to load it directly from my windows machine to hive table.
com.cloudera.hiveserver2.support.exceptions.ErrorException
Error while compiling statement: FAILED: SemanticException [Error 10028]: Line 1:23 Path is not legal
I am using below piece of code for loading data.
query="""LOAD DATA LOCAL INPATH 'C:/Users/Docs/file.csv' INTO TABLE default.logstable"""
conn = getConnection()
curr = conn.cursor()
curr.execute(query)
connection was already setup, select queries are working fine.
query=r"""LOAD DATA LOCAL INPATH 'C:/Users/Docs/file.csv' INTO TABLE default.logstable"""Form the query as raw string realpython.com/python-raw-strings or escape the pathquery="""LOAD DATA LOCAL INPATH 'C://Users//Docs//file.csv' INTO TABLE default.logstable"""