Hive / HCatalog Forum

Hive ODBC query error

  • #45534
    Adnan Fiaz

    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’.”
    [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?

to create new topics or reply. | New User Registration

  • Author
  • #45535
    Adnan Fiaz

    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.

    Thejas Nair

    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.

    Adnan Fiaz

    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!

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

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.