Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Sqoop import into Hive: derby metastore used instead of postgres

Sqoop import into Hive: derby metastore used instead of postgres

I'm trying to sqoop data into Hive Orc table using hcatalog from Oozie.
Here are arguments:

import
--connect
jdbc:sqlserver://some-server:1433
--username 
some-db-user
--password-file 
********
--hcatalog-database 
smoketest
--hcatalog-table 
some-table
--hcatalog-storage-stanza 
stored as orcfile
--split-by
main_id
--query
select top 100 col1 from test.dbo.test_table WHERE $CONDITIONS
--m
1
--verbose

Hive metastore is configures to postgres:

/hadoop/hdp/2.6.3.0-235/hive2/bin/schematool -dbType postgres -info -verbose

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/hadoop/hdp/2.6.3.0-235/hive2/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/hadoop/hdp/2.6.3.0-235/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Metastore connection URL:        jdbc:postgresql://server:5432/hive
Metastore Connection Driver :    org.postgresql.Driver
Metastore connection User:       hive
Hive distribution version:       2.1.2000
Metastore schema version:        2.1.2000
schemaTool completed


However, when I run the workflow, following exception is raised (suggesting that derby is configued):

java.sql.SQLSyntaxErrorException: Table/View 'DBS' does not exist.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement42.<init>(Unknown Source)
	at org.apache.derby.jdbc.Driver42.newEmbedPreparedStatement(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
	at com.jolbox.bonecp.ConnectionHandle.prepareStatement(ConnectionHandle.java:1193)
	at org.datanucleus.store.rdbms.SQLController.getStatementForQuery(SQLController.java:345)
	at org.datanucleus.store.rdbms.query.RDBMSQueryUtils.getPreparedStatementForQuery(RDBMSQueryUtils.java:211)
	at org.datanucleus.store.rdbms.query.SQLQuery.performExecute(SQLQuery.java:633)
	at org.datanucleus.store.query.Query.executeQuery(Query.java:1844)
	at org.datanucleus.store.rdbms.query.SQLQuery.executeWithArray(SQLQuery.java:807)
	at org.datanucleus.store.query.Query.execute(Query.java:1715)
	at org.datanucleus.api.jdo.JDOQuery.executeInternal(JDOQuery.java:371)
	at org.datanucleus.api.jdo.JDOQuery.execute(JDOQuery.java:213)
	at org.apache.hadoop.hive.metastore.MetaStoreDirectSql.runTestQuery(MetaStoreDirectSql.java:261)
	at org.apache.hadoop.hive.metastore.MetaStoreDirectSql.<init>(MetaStoreDirectSql.java:161)
	at org.apache.hadoop.hive.metastore.ObjectStore.initializeHelper(ObjectStore.java:402)
	at org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:322)
	at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:283)

What could be the reason?

I've checked hive-site.xml via console and Ambari - they all point metastore to postgres.

Don't have an account?
Coming from Hortonworks? Activate your account here