Srini
Srini

Reputation: 1

Sqoop export using query

We are trying to export the data from HIVE tables into HANA, able to export the data using --hcatalog table options in the Sqoop export command.

But facing issues when trying to load the data using the query option with the where clause

Is it possible to use the query option in the sqoop export command?

My Sample scoop command is like below

sqoop export -D sqoop.export.records.per.statement=1 -D mapreduce.map.memory.mb=16384 -D mapreduce.map.java.opts=-Xmx16384m  --connect "jdbc:xxxxxx" --driver "com.sap.db.jdbc.Driver" --username "xxxxx" --password "xxxxxx" --table "hanaschema.table1" --query "select field1,substr(field2,1),field3,field4,from "hadoopschema.table" where field1 = 2017 and field3 = 4" --input-null-string '\\N' --input-null-non-string '\\N' --num-mappers 20 –-validate

Appreciate your help..

Thanks Srini

Upvotes: 0

Views: 11092

Answers (1)

Sandeep Singh
Sandeep Singh

Reputation: 8010

Unfortunately --query argument is not supported with Sqoop Export yet. We can use this with Sqoop import command only.

Please refer Export control arguments section for detailed information about available option in Sqoop export.

Alternatively copy the output of your query into another table and then export that table into HANA.

Upvotes: 4

Related Questions