Created 12-14-2015 05:37 AM
sqoop import --driver oracle.jdbc.driver.OracleDriver --connect jdbc:oracle:thin:@ipaddress:1521:orcl --username username --password password --table T_PROJECT --delete-target-dir --warehouse-dir /foo
The above one is simple sqoop command i executed.This tries to execute following command to know the columns."SELECT t.* FROM T_PROJECT AS t WHERE 1=0" (False condition to know columns of table) .Unfortunately this won't work in oracle.If i changed the database to mysql,It is working well.Where is the logic.How to execute above command for oracle database.
Created 12-14-2015 12:05 PM
Skip --driver oracle.jdbc.driver.OracleDriver - Bug
Run this
sqoop import --connect jdbc:oracle:thin:@ipaddress:1521:orcl --username username --password password --table T_PROJECT --delete-target-dir --warehouse-dir /foo
Created 12-14-2015 11:13 AM
Please share the output of sqoop while running it for oracle. I have never experienced any issues while running simple import from oracle to hive using sqoop.
I don't have oracle instance running but you can see working example here
Created on 12-14-2015 11:26 AM - edited 08-19-2019 05:37 AM
HI Neeraj,
The following pic shows the error.The respective command is as i wrote in the question only with -m 1 option.The oracle imports are working well with query.But i try to import data using --table option instead of --query there i am getting error.This command is working fine with Mysql. I taught Sqoop using select t.* from T_PROJECT as t where 1=0 to determine column names,there oracle database suffers.And it is executing well in Mysql.
Created 12-14-2015 11:56 AM
@Suresh Bonam The problem is with "AS" operator Bug
What is the ojdbc version?
Created 12-14-2015 12:02 PM
The ojdbc version is 14. How to solve it??
Created 12-14-2015 12:05 PM
Skip --driver oracle.jdbc.driver.OracleDriver - Bug
Run this
sqoop import --connect jdbc:oracle:thin:@ipaddress:1521:orcl --username username --password password --table T_PROJECT --delete-target-dir --warehouse-dir /foo
Created 12-15-2015 12:29 PM
@Suresh Bonam Did it work? If yes then please accept the answer for future reference.
Created 12-15-2015 12:35 PM
Yupp..its working fine...Tq