AnsweredAssumed Answered

Exception when trying to import DB table with sqoop and hive

Question asked by stracso on Apr 12, 2013
Latest reply on May 7, 2013 by stracso
I installed a M3 cluster, 8 nodes. The dsitribution was 2.0.1.

I am trying to use sqoop to import tables from a Oracle DB into MapR and import the table definition in HIVE. But when I run the sqoop import command, I get an exception. This is the sqoop command:

<code>
sqoop  --options-file ./iso_country.sqoop
My options file is as follows:
import
--connect
jdbc:oracle:thin:@//remote-db-server:1536/DBNAME
--username
READ_ONLY_USR
--password
usrpwd
--table
COUNTRY_TABLE
--columns
ISO_COUNTRY_CODE, ISO_COUNTRY_NAME
--hive-overwrite
--hive-import
--hive-table
COUNTRY_TABLE
</code>

Everything goes well, the table data is imported into the MapR filesystem (I can look at the data on the filesystem, it looks fine). -- but when sqoop tries to import into HIVE, I get this exception:
<pre>
13/04/12 11:55:02 INFO hive.HiveImport: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
13/04/12 11:55:02 INFO hive.HiveImport:  at org.apache.hadoop.hive.ql.metadata.Hive.getTablesByPattern(Hive.java:1011)
13/04/12 11:55:02 INFO hive.HiveImport:  at org.apache.hadoop.hive.ql.metadata.Hive.getTablesByPattern(Hive.java:996)
13/04/12 11:55:02 INFO hive.HiveImport:  at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeCreateTable(SemanticAnalyzer.java:8732)
13/04/12 11:55:02 INFO hive.HiveImport:  at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:8097)
13/04/12 11:55:02 INFO hive.HiveImport:  at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:258)
13/04/12 11:55:02 INFO hive.HiveImport:  at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:431)
13/04/12 11:55:02 INFO hive.HiveImport:  at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:335)
13/04/12 11:55:02 INFO hive.HiveImport:  at org.apache.hadoop.hive.ql.Driver.run(Driver.java:893)
13/04/12 11:55:02 INFO hive.HiveImport:  at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:259)
13/04/12 11:55:02 INFO hive.HiveImport:  at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216)
13/04/12 11:55:02 INFO hive.HiveImport:  at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:412)
13/04/12 11:55:02 INFO hive.HiveImport:  at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:347)
13/04/12 11:55:02 INFO hive.HiveImport:  at org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:445)
13/04/12 11:55:02 INFO hive.HiveImport:  at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:455)
13/04/12 11:55:02 INFO hive.HiveImport:  at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:711)
13/04/12 11:55:02 INFO hive.HiveImport:  at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:613)
13/04/12 11:55:02 INFO hive.HiveImport:  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13/04/12 11:55:02 INFO hive.HiveImport:  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
13/04/12 11:55:02 INFO hive.HiveImport:  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
13/04/12 11:55:02 INFO hive.HiveImport:  at java.lang.reflect.Method.invoke(Method.java:597)
13/04/12 11:55:02 INFO hive.HiveImport:  at org.apache.hadoop.util.RunJar.main(RunJar.java:197)
13/04/12 11:55:02 INFO hive.HiveImport: Caused by: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
</pre>


What could be the problem? - I can use Hive CLI or Beeline, or the web UI fine.

Outcomes