Problems in running Hive queries
Question
I have configured Hadoop and Hive on Windows through Cygwin. But I am facing some problems like:
in hive terminal (CLI):
hive>
When I enter query, the query do not execute and terminal remains busy.
If I enter the query like:
bin/hive -e 'LOAD DATA INPATH 'kv1.txt' OVERWRITE INTO TABLE pokes;'
The Output is like this:
Hive history file=/tmp/Bhavesh.Shah/hive_job_log_Bhavesh.Shah_201111301549_1377455380.txt
FAILED: Parse Error: line 1:17 mismatched input 'kv1' expecting StringLiteral near 'INPATH' in load statement
What could be the problem?
Solution
Try
bin/hive -e 'LOAD DATA INPATH kv1.txt OVERWRITE INTO TABLE pokes;'
without the single quotes around kv1.txt
.
OTHER TIPS
If your file on the local file system try
bin/hive -e 'LOAD DATA LOCAL INPATH kv1.txt OVERWRITE INTO TABLE pokes;'
By default it looks for the file in HDFS.
If your file on the local file system try
bin/hive -e 'LOAD DATA LOCAL INPATH give absolute localpath OVERWRITE INTO TABLE pokes;'
If your file on the HDFS file system try
bin/hive -e 'LOAD DATA LOCAL INPATH give absolute HDFS path OVERWRITE INTO TABLE pokes;'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow