I want to create a table schema in Hive using "sqoop create-hive-table " . My DB is an Oracle Database 10g Enterprise Edition 10.2.0.4.0 , I use sqoop-1.2.0-cdh3u0 and hive-0.7.0-cdh3u0. The data to load afterwards on the Hive table is already on the HDFS, and I would prefer having the table metadata created automatically by sqoop & hive rather than creating it manually and loading the data afterwards.
Here is the command I execute :
$ sqoop create-hive-table --connect jdbc:oracle:thin:@//dbserver:1521/masterdb
--username myuser --table DBFUNC1.R1_EVOLUTION
--fields-terminated-by ',' -P
And I get the following error :
11/05/12 11:33:11 INFO hive.HiveImport: Loading uploaded data into Hive
11/05/12 11:33:12 INFO manager.OracleManager: Time zone has been set to GMT 11/05/12
11:33:12 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM BFUNC1.R1_EVOLUTION t WHERE 1=0
11/05/12 11:33:14 INFO hive.HiveImport: Hive history file=/tmp/edjatsay/hive_job_log_edjatsay_201105121133_1466429457.txt
11/05/12 11:33:14 INFO hive.HiveImport: FAILED: Parse Error: line 1:58 mismatched input ')' expecting Identifier in column specification
11/05/12 11:33:14 INFO hive.HiveImport:
11/05/12 11:33:14 ERROR tool.CreateHiveTableTool: Encountered IOException running create table job: java.io.IOException: Hive exited with status 11
Here is the schema of the table in the DB :
SQL> describe BFUNC1.R1_EVOLUTION;
OWNER_ID NOT NULL NUMBER(38)
AI_CODE NOT NULL CHAR(3)
TA_NUMBER NOT NULL NUMBER(38)
RULE NOT NULL CHAR(4)
F_CLASS NOT NULL CHAR(8)
EVOLUTION_ID NOT NULL NUMBER(38)
CREATION_MODIFID NUMBER(38)
DISC_MODIFID NUMBER(38)
CREATION_DATETIME CHAR(19)
ENDED_DATETIME CHAR(19)
EVOLUTION_STATE CHAR(1)
Thanks in advance for your help.