Question

I'm using Horton-works Hadoop solution and I'm unable to execute hive command line interface commands.

  1. Using -e option, with command as follows

    C:\somepath\hive-0.11\bin>hive -e 'select * from sampletable'
    

    Here, I get the error

    'ParseException', cannot recognize input near '', '' in select clause.

  2. Using -f option, with commands as follows

    C:\somepath\hive-0.11\bin>hive -f /user/myusername/sample.sql
    

    Here I get the error

    unable to read the file at specified location.

What am I doing wrong?

Was it helpful?

Solution

Not quite sure what is going on in case 1). Maybe the windows shell expands things in a weird way? Try hive -e "select * from sampletable"

With your second one, I'm guessing you are passing in a hdfs path for some reason. This is most certainly not what you want, as it is looking for a file in your local file system. Where is it locally?:

hive -f C:\path\to\sample.sql
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top