Reply
Highlighted
New Contributor
Posts: 4
Registered: ‎10-20-2017
Accepted Solution

SQL Query Failed with Cloudera Hive JDBC driver but works fine in Hue

[ Edited ]

We have a Hive SQL that runs fine in Hue but when we run that same query via Hive JDBC driver it fails with the below error message,

 

java.sql.SQLException: [Cloudera][HiveJDBCDriver](500051) ERROR processing query/statement. Error Code: 10009, SQL state: TStatus(statusCode:ERROR_STATUS, infoMessages:[*org.apache.hive.service.cli.HiveSQLException:Error while compiling statement: FAILED: SemanticException [Error 10009]: Line 1:5602 Invalid table alias 'F':17:16, org.apache.hive.service.cli.operation.Operation:toSQLException:Operation.java:400, org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:187, org.apache.hive.service.cli.operation.SQLOperation:runInternal:SQLOperation.java:271, org.apache.hive.service.cli.operation.Operation:run:Operation.java:337, org.apache.hive.service.cli.session.HiveSessionImpl:executeStatementInternal:HiveSessionImpl.java:439, org.apache.hive.service.cli.session.HiveSessionImpl:executeStatementAsync:HiveSessionImpl.java:416, org.apache.hive.service.cli.CLIService:executeStatementAsync:CLIService.java:282, org.apache.hive.service.cli.thrift.ThriftCLIService:ExecuteStatement:ThriftCLIService.java:501, org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1313, org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1298, org.apache.thrift.ProcessFunction:process:ProcessFunction.java:39, org.apache.thrift.TBaseProcessor:process:TBaseProcessor.java:39, org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge$Server$TUGIAssumingProcessor:process:HadoopThriftAuthBridge.java:705, org.apache.thrift.server.TThreadPoolServer$WorkerProcess:run:TThreadPoolServer.java:286, java.util.concurrent.ThreadPoolExecutor:runWorker:ThreadPoolExecutor.java:1142, java.util.concurrent.ThreadPoolExecutor$Worker:run:ThreadPoolExecutor.java:617, java.lang.Thread:run:Thread.java:745, *org.apache.hadoop.hive.ql.parse.SemanticException:Line 1:5602 Invalid table alias 'F':36:20, 

Cloudera Employee
Posts: 228
Registered: ‎03-23-2015

Re: SQL Query Failed with Cloudera Hive JDBC driver but works fine in Hue

I don't see what exact query was sent to HS2 to run that caused the issue. But from the error message, it looks like that there is some issue on the query string itself. This could happen when there is bugs in the HIve JDBC driver that you are using and does not tramsform query correctly.

Couple of things you can check:

1. what version of JDBC driver are you using? If not latest, maybe try the latest version:

https://www.cloudera.com/downloads/connectors/hive/jdbc/2-5-19.html

2. Check if UseNativeQuery is set or not, Default is 0, meaning it will transform query inside JDBC before sending to HS2. You can try to set it to 1 to disable transformation. Details can be found here:

http://www.cloudera.com/documentation/other/connectors/hive-jdbc/latest/Cloudera-JDBC-Driver-for-Apa...
New Contributor
Posts: 4
Registered: ‎10-20-2017

Re: SQL Query Failed with Cloudera Hive JDBC driver but works fine in Hue

[ Edited ]

worked with enabling the use of Native query option. Thanks for your help.

Announcements