Stormcloud
Stormcloud

Reputation: 2307

sqoop: How to grab incremental updates from mySql

I'm trying to get Sqoop to read the content of a mysql table. So far I've managed to dump the complete content of the table HDFS and I've also managed to get an incremental update based on an id. What I'm unable to do is get an incremental update based up on a date or datetime stamp. The job appears to run correctly (there are no errors), but nothing is written to HDFS

The command I'm running is:

sqoop import 
    --connect jdbc:mysql://localhost/myDb 
    --username me 
    --password myPassword 
    --warehouse-dir /inc-3 
    --table myTable 
    --incremental lastmodified 
    --check-column datestamp 
    --last-value '2005-12-01'

All my data is less that 3 years old, so I would have expected the query to have returned everything.

Update: This is a question on how to use Sqoop, not a question on Sql programming

Upvotes: 3

Views: 328

Answers (1)

unchained
unchained

Reputation: 29

check a few things: 1)) datatype of datestamp in mysql is described correctly 2))use <--last-value 2005-12-01> without the quotes on the value.

Works for me. Good luck!

Upvotes: 1

Related Questions