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.

INFO hive.HiveImport: FAILED: Error in metadata: Invalid table name

INFO hive.HiveImport: FAILED: Error in metadata: Invalid table name

New Contributor


[cghosh@usmbg-lcldpoct1 ~]$ sqoop import \
> --connect jdbc:oracle:thin:@usmbg-lcpmdbt1.amer.exel-intra.net:1592:CPMDWDEV \
> --username obaw \
> --password xxxxxx \
> --table EDW.XXOB_GL_ACCOUNT_HIER_WIDS -m 1 \
> --hive-import \
> --hive-table EDW.XXOB_GL_ACCOUNT_HIER_WIDS \
> --target-dir /user/cghosh/sqoopimport/DWDEV/TEST

 

Here Oracle Database name “CPMDWDEV” , Table owner user id - “edw” and Connected id –“obaw”
So i am connecting as a user obaw and have select privillage on a table from a user id edw
in this command not sure how it will find the table under the edw id while i am connecting as obaw


-- Error
13/09/03 14:41:57 WARN mapred.JobClient: Use GenericOptionsParser for parsing the arguments. Applications should implement Tool for the same.
13/09/03 14:41:59 INFO mapred.JobClient: Running job: job_201308261314_0012
13/09/03 14:42:00 INFO mapred.JobClient: map 0% reduce 0%
13/09/03 14:45:41 INFO mapred.JobClient: map 100% reduce 0%
13/09/03 14:45:42 INFO mapred.JobClient: Job complete: job_201308261314_0012
13/09/03 14:45:42 INFO mapred.JobClient: Counters: 23
....................
....................

13/09/03 14:45:42 INFO hive.HiveImport: Loading uploaded data into Hive
13/09/03 14:45:44 INFO hive.HiveImport: Logging initialized using configuration in jar:file:/usr/lib/hive/lib/hive-common-0.10.0-cdh4.3.0.jar!/hive-log4j.properties
13/09/03 14:45:44 INFO hive.HiveImport: Hive history file=/tmp/cghosh/hive_job_log_4503e0a3-7657-4ded-b119-ebf82e009ad1_1377473496.txt
13/09/03 14:45:46 INFO hive.HiveImport: org.apache.hadoop.hive.ql.metadata.HiveException: Invalid table name: CPMDWDEV.EDW.XXOB_GL_ACCOUNT_HIER_WIDS
13/09/03 14:45:46 INFO hive.HiveImport: at org.apache.hadoop.hive.ql.metadata.Hive.newTable(Hive.java:2264)
13/09/03 14:45:46 INFO hive.HiveImport: at org.apache.hadoop.hive.ql.exec.DDLTask.createTable(DDLTask.java:3557)
13/09/03 14:45:46 INFO hive.HiveImport: at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:254)
13/09/03 14:45:46 INFO hive.HiveImport: at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:138)
13/09/03 14:45:46 INFO hive.HiveImport: at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:57)
13/09/03 14:45:46 INFO hive.HiveImport: at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1374)
13/09/03 14:45:46 INFO hive.HiveImport: at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1160)
13/09/03 14:45:46 INFO hive.HiveImport: at org.apache.hadoop.hive.ql.Driver.run(Driver.java:973)
13/09/03 14:45:46 INFO hive.HiveImport: at org.apache.hadoop.hive.ql.Driver.run(Driver.java:893)
13/09/03 14:45:46 INFO hive.HiveImport: at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:259)
13/09/03 14:45:46 INFO hive.HiveImport: at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216)
13/09/03 14:45:46 INFO hive.HiveImport: at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:412)
13/09/03 14:45:46 INFO hive.HiveImport: at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:347)
13/09/03 14:45:46 INFO hive.HiveImport: at org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:445)
13/09/03 14:45:46 INFO hive.HiveImport: at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:455)
13/09/03 14:45:46 INFO hive.HiveImport: at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:713)
13/09/03 14:45:46 INFO hive.HiveImport: at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:613)
13/09/03 14:45:46 INFO hive.HiveImport: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13/09/03 14:45:46 INFO hive.HiveImport: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
13/09/03 14:45:46 INFO hive.HiveImport: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
13/09/03 14:45:46 INFO hive.HiveImport: at java.lang.reflect.Method.invoke(Method.java:597)
13/09/03 14:45:46 INFO hive.HiveImport: at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
13/09/03 14:45:46 INFO hive.HiveImport: FAILED: Error in metadata: Invalid table name: CPMDWDEV.EDW.XXOB_GL_ACCOUNT_HIER_WIDS
13/09/03 14:45:46 INFO hive.HiveImport: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
13/09/03 14:45:46 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: Hive exited with status 1
at org.apache.sqoop.hive.HiveImport.executeExternalHiveScript(HiveImport.java:366)
at org.apache.sqoop.hive.HiveImport.executeScript(HiveImport.java:316)
at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:228)
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:415)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:476)
at org.apache.sqoop.Sqoop.run(Sqoop.java:145)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:220)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:229)
at org.apache.sqoop.Sqoop.main(Sqoop.java:238)

2 REPLIES 2

Re: INFO hive.HiveImport: FAILED: Error in metadata: Invalid table name

New Contributor

Got the answer from Chris - Systems Engineer - Cloudera

 

"--table" will refer to the Oracle schema and tablename

"--hive-table" will be the name of the database and table you are creating in Hive.  

 

If you aren't using a database other than the default database, then this value will be just the name of the table you are trying to create in Hive.  

 

[cghosh@usmbg-lcldpoct1 ~]$ sqoop import \

> --connect jdbc:oracle:thin:@usmbg-lcpmdbt1.amer.exel-intra.net:1592:CPMDWDEV \

> --username obaw \

> --password oracle \

> --table EDW.XXOB_GL_ACCOUNT_HIER_WIDS -m 1 \

> --hive-import \

> --hive-table XXOB_GL_ACCOUNT_HIER_WIDS \

> --target-dir /user/cghosh/sqoopimport/DWDEV/TEST

Highlighted

Re: INFO hive.HiveImport: FAILED: Error in metadata: Invalid table name

New Contributor

Topic: INFO hive.HiveImport: FAILED: Error in metadata: Invalid table name
Date: Tue Sep 03 12:07:06 PDT 2013

Did it solve your problem?

Click here to view the reply and mark one as an Accepted Solution.

This helps others find helpful answers in the community too!

 

Yes

 

i was using schemaname.tablename in hive and that was the problem

> --hive-table EDW.XXOB_GL_ACCOUNT_HIER_WIDS \

 

took out the schemaname from hive , just left in sqoop part

 

> --table EDW.XXOB_GL_ACCOUNT_HIER_WIDS -m 1 \

> --hive-import \

> --hive-table XXOB_GL_ACCOUNT_HIER_WIDS \