Welcome to the Cloudera Community

Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Who agreed with this topic

JDBC Hive connection failure - Exception: Syntax error ), Query: set -v.

avatar
New Contributor

Hi

 

I'm trying to connect to Hive 1.1.0-cdh5.11.2, using 2.6.1 Cloudera JDBC driver.

Getting the next error:

java.sql.SQLException: [Cloudera][HiveJDBCDriver](500151) Error setting/closing session: Open Session Error.
    at com.cloudera.hiveserver2.hivecommon.api.ExtendedHS2Client.openSession(Unknown Source)
    at com.cloudera.hiveserver2.hivecommon.api.HS2Client.<init>(Unknown Source)
    at com.cloudera.hiveserver2.hivecommon.api.ExtendedHS2Client.<init>(Unknown Source)
    at com.cloudera.hiveserver2.hivecommon.api.ZooKeeperEnabledExtendedHS2Factory.createClient(Unknown Source)
    at com.cloudera.hiveserver2.hivecommon.core.HiveJDBCCommonConnection.establishConnection(Unknown Source)
    at com.cloudera.hiveserver2.jdbc.core.LoginTimeoutConnection.connect(Unknown Source)
    at com.cloudera.hiveserver2.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)
    at com.cloudera.hiveserver2.jdbc.common.AbstractDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(DriverManager.java:664)
    at java.sql.DriverManager.getConnection(DriverManager.java:270)
Caused by: com.cloudera.hiveserver2.support.exceptions.GeneralException: [Cloudera][HiveJDBCDriver](500151) Error setting/closing session: Open Session Error.
    ... 10 more
Caused by: com.cloudera.hiveserver2.support.exceptions.GeneralException: [Cloudera][HiveJDBCDriver](500051) ERROR processing query/statement. Error Code: 0, SQL state: TStatus(statusCode:ERROR_STATUS, sqlState:HY000, errorMessage:AnalysisException: Syntax error in line 1:
set -v
    ^
Encountered: -
Expected: DEFAULT, IDENTIFIER

CAUSED BY: Exception: Syntax error
), Query: set -v.
    at com.cloudera.hiveserver2.hivecommon.api.HS2Client.executeStatementInternal(Unknown Source)
    at com.cloudera.hiveserver2.hivecommon.api.HS2Client.executeStatement(Unknown Source)
    at com.cloudera.hiveserver2.hivecommon.api.HS2Client.runCatalogFunction(Unknown Source)
    ... 10 more

 

Have ho idea why "set -v" is not working there - it works fine if executing from Query editor in Hue

 

P.S. I was able to connect to Hive using the very first 2.5.10 driver version, but there I can not select some tables returned by "show tables"...

 

Any thoughts?

Thanks

 

Who agreed with this topic