Diddy
Diddy

Reputation: 193

Sqoop exporting partitioned Hive table

I encountered some problems when trying to export a partitioned Hive table. Is this fully supported (I tried to google for it and found one JIRA ticket)?

sqoop export --connect jdbc:mysql://localhost/testdb --table sales --export-dir /user/hive/warehouse/sales --direct

And here is what I get:

00000_2, Status : FAILED
java.io.FileNotFoundException: File does not exist: /user/hive/warehouse/sales/day=2013-04-01

Running

hadoop fs -ls /user/hive/warehouse/sales/day=2013-04-01

shows that this directory actually exists.

Any ideas on how to solve this? Thanks in advance, Diddy

Upvotes: 2

Views: 5440

Answers (2)

Clemens Valiente
Clemens Valiente

Reputation: 867

This question is quite old, but in case somebody stumbles upon it, please use

--export-dir /user/hive/warehouse/sales/*" 

to export all partitions within a table.

Upvotes: 1

Jarek Jarcec Cecho
Jarek Jarcec Cecho

Reputation: 1726

Sqoop currently do not support export for recursive directories. There is a JIRA SQOOP-951 for adding such support. The workaround for the time being is to export one partition at the time or temporarily copy your data to non partitioned table.

Upvotes: 1

Related Questions