Home Forums Hive / HCatalog Hive ODBC query error

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  Adnan Fiaz 3 months, 4 weeks ago.

  • Creator
    Topic
  • #45534

    Adnan Fiaz
    Member

    Hi, I am trying to execute a query using an ODBC connection to Hive within R (using the RODBC library). My connection to Hive seems to work fine, I have followed the instructions as mentioned in the ODBC driver installation documents. I also know it works fine because I have executed the following queries successfully:
    - show tables
    - describe table1
    - select * from table1

    The problem occurs when I try to retrieve a specific column from the table. In other words the query “select col1 from table1″ fails with the following error:
    HY000 35 [Hortonworks][Hardy] (35) Error from Hive: error code: ’1′ error message: ‘Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask’.”
    [2] “[RODBC] ERROR: Could not SQLExecDirect ‘SELECT col1 FROM table1 LIMIT 10′

    Now I’m not sure if the problem lies with Hive, the ODBC driver or with R. Any thoughts?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Hive ODBC query error’ is closed to new replies.

  • Author
    Replies
  • #45806

    Adnan Fiaz
    Member

    Thank you for the advice, never occurred to me to look in the logs. The logs showed a permission denied error. As specified in the installation instruction I configured the ODBC driver to log on as user hadoop but this user has no write access. I changed the user to hdfs and the query works. Thanks again!

    Collapse
    #45735

    Thejas Nair
    Participant

    The commands that worked for you don’t launch a map reduce job. It looks like there is a problem while launching map-reduce jobs. Can you check the hive logs (default location, assuming you are running hiveserver2 as user hive) – /tmp/hive/hive.log to see if it has the full error message ? If you see that MR job was launched, you can also use the job tracker UI to see why the job might have failed.

    Collapse
    #45535

    Adnan Fiaz
    Member

    FYI, I’ve tried playing around with quotation marks but no luck. Also tried to use table.col1 instead of just col1 but that didn’t work either.

    Collapse
Viewing 3 replies - 1 through 3 (of 3 total)