Created 06-14-2016 06:59 PM
I am trying to run this query to load data from Hive Table to HDFS file. IT executes successfully but does not show any CSV file in the directory(sTestData) in hdfs. Any suggestions on what may be wrong with query or the access to the hdfs directory ?
INSERT OVERWRITE LOCAL DIRECTORY '/STestData/customershare.csv' ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' SELECT * FROM stestdata.customershare
Created 06-14-2016 07:06 PM
The LOCAL keyword tells Hive to write the data to the local filesystem, not HDFS.
Created 06-14-2016 07:06 PM
The LOCAL keyword tells Hive to write the data to the local filesystem, not HDFS.
Created 06-14-2016 07:10 PM
Thanks Michael. I removed local keyword and it works fine now. Is there a specific location in local where it creates this in subdirectory by default ?
Created 06-14-2016 07:16 PM
You are welcome. Don't forget to accept the answer. 🙂
It should use the full pathname you specify after the DIRECTORY keyword. A common testing approach would be to use the tmp directory like '/tmp/my-output.cvv' and see if it is working as expected.
Created 06-21-2016 11:30 PM
Insert Overwrite is creating a CSV file as directory name and with a file named 000000_0 with all the content. How can I make this to create CSV file with exact name that I give like customershare.csv from above query ?