Support Questions

Find answers, ask questions, and share your expertise

Hive problem in HUE after update to mysql

Explorer

Dear community, 

 

I have set up a new cluster in AWS using CDH 5.11.0 using the Cloudera Director. 

Originally, the Hive service was configered with postgres as metastore DB. 

 

I changed to mysql and followed all relevant steps.

The service is healthy in Cloudera manager, however when I try to create a new database, the following error pops up:  

 

Error while compiling statement: FAILED: SemanticException [Error 10072]: Database does not exist: default

It seems, as if the default database is missing.

Also I'm not able to install the examples: 

 

Could not install table: Error creating table sample_07: Bad status for request TExecuteStatementReq(confOverlay={}, sessionHandle=TSessionHandle(sessionId=THandleIdentifier(secret='(\xf9p\xe0f\x17O\xe4\xb6\x88 Z\x0c\x83G\xa3', guid='u\xbf\xbb\xd1J\x91IK\x8b\xdeWH\x07\xd7LU')), runAsync=False, statement='USE `default`'): TExecuteStatementResp(status=TStatus(errorCode=10072, errorMessage='Error while compiling statement: FAILED: SemanticException [Error 10072]: Database does not exist: default', sqlState='42000', infoMessages=['*org.apache.hive.service.cli.HiveSQLException:Error while compiling statement: FAILED: SemanticException [Error 10072]: Database does not exist: default:29:28', 'org.apache.hive.service.cli.operation.Operation:toSQLException:Operation.java:400', 'org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:188', 'org.apache.hive.service.cli.operation.SQLOperation:runInternal:SQLOperation.java:267', '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:executeStatement:HiveSessionImpl.java:405', 'sun.reflect.NativeMethodAccessorImpl:invoke0:NativeMethodAccessorImpl.java:-2', 'sun.reflect.NativeMethodAccessorImpl:invoke:NativeMethodAccessorImpl.java:57', 'sun.reflect.DelegatingMethodAccessorImpl:invoke:DelegatingMethodAccessorImpl.java:43', 'java.lang.reflect.Method:invoke:Method.java:606', 'org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:78', 'org.apache.hive.service.cli.session.HiveSessionProxy:access$000:HiveSessionProxy.java:36', 'org.apache.hive.service.cli.session.HiveSessionProxy$1:run:HiveSessionProxy.java:63', 'java.security.AccessController:doPrivileged:AccessController.java:-2', 'javax.security.auth.Subject:doAs:Subject.java:415', 'org.apache.hadoop.security.UserGroupInformation:doAs:UserGroupInformation.java:1920', 'org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:59', 'com.sun.proxy.$Proxy27:executeStatement::-1', 'org.apache.hive.service.cli.CLIService:executeStatement:CLIService.java:257', '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.hive.service.auth.TSetIpAddressProcessor:process:TSetIpAddressProcessor.java:56', 'org.apache.thrift.server.TThreadPoolServer$WorkerProcess:run:TThreadPoolServer.java:286', 'java.util.concurrent.ThreadPoolExecutor:runWorker:ThreadPoolExecutor.java:1145', 'java.util.concurrent.ThreadPoolExecutor$Worker:run:ThreadPoolExecutor.java:615', 'java.lang.Thread:run:Thread.java:745', '*org.apache.hadoop.hive.ql.parse.SemanticException:Database does not exist: default:35:7', 'org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer:getDatabase:BaseSemanticAnalyzer.java:1310', 'org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer:analyzeSwitchDatabase:DDLSemanticAnalyzer.java:815', 'org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer:analyzeInternal:DDLSemanticAnalyzer.java:431', 'org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer:analyze:BaseSemanticAnalyzer.java:223', 'org.apache.hadoop.hive.ql.Driver:compile:Driver.java:494', 'org.apache.hadoop.hive.ql.Driver:compileInternal:Driver.java:1279', 'org.apache.hadoop.hive.ql.Driver:compileAndRespond:Driver.java:1266', 'org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:186'], statusCode=3), operationHandle=None).

Interestingly, in the hive warehouse location on the HDFS (standard setting: /user/hive/warehouse), I can find the tables. 

Thanks for some help. 

3 REPLIES 3

Champion

@gjaehrling

 

As usual there could be multiple reasons for this issue and one common reason is you might have used an un-suitable MySQL Connector version 

 

I've already shared some information about MySQL Connector in this link. It may help you... (The topic is different but you can use it to get some info about MySQL Connector)

 

https://community.cloudera.com/t5/Web-UI-Hue-Beeswax/Unable-to-create-Sqoop-Connection-Link-in-Hue/m...

 

 

Champion
Did you migrate the metadata out of postgres ad into mysql?

Explorer

you are right, I should have migrated the content before changing the database. 

That was the problem. 

 

Thansk & cheers