Reply
Roy
Explorer
Posts: 18
Registered: ‎10-09-2014

sqoop import from vertica failed

Hi, 

 

  I am trying to import dataset from Vertica to HDFS using sqoop.

 

On my hadoop cluster I am running command as abc user, but I dont have abc user on vertica, I have xyz user on vertica.

 

I a running following query on sqoop machines to import data into hdfs from Vertica v6.0.1-7

sqoop import -m 1 --driver com.vertica.jdbc.Driver --connect "jdbc:vertica://10.10.10.10:5433/MYDB" --password dbpassword --username dbusername --target-dir "/user/my/hdfs/dir" --verbose --query 'SELECT * FROM ORDER_V2 LIMIT 10;'

 

but i am getting some error here,

16/02/03 10:33:17 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: Query [SELECT * FROM ORDER_V2 LIMIT 10;] must contain '$CONDITIONS' in WHERE clause.
	at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:300)
	at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1833)
	at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1645)
	at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:96)
	at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)
	at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)
	at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
	at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
	at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
	at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
	at org.apache.sqoop.Sqoop.main(Sqoop.java:236)

Anyone knows how to do this, considering different username on both machines.

 

Thanks

 

 

Highlighted
Roy
Explorer
Posts: 18
Registered: ‎10-09-2014

Re: sqoop import from vertica failed

Got resolved by following command.

 

sqoop import -m 1 --driver com.vertica.jdbc.Driver --connect "jdbc:vertica://10.10.10.10:5433/MYDB" --password dbpassword --username dbusername --target-dir "/user/my/hdfs/dir" --verbose --query 'SELECT * FROM ORDER_V2 LIMIT 10 WHERE $CONDITIONS;'