Why sqoop job is not creating dynamic sub-director

2019-08-26 00:24发布

问题:

I am using sqoop to import Oracle data to HDFS directory. I have created the sqoop job for the same. I have used follwoing command to create sqoop job-

sqoop job --create TABLE_NAME -- import  --connect jdbc:oracle:thin:/system@HOST_NAME:PORT:SERVICE --username USERNAME --password-file /MYPASSWORD.txt --fields-terminated-by ',' --enclosed-by '"'  --table USERNAME.TABLE_NAME --target-dir /TABLE_NAME/$(date --date "-1 days" +%F)/ -m 1 --incremental append --check-column DATE_COLUMN --last-value '2019-01-01 00:00:00.000'  --split-by PRIMARY_KEY --null-string ""  --null-non-string ""

And I executed this sqoop job by using below command-

sqoop job --exec TABLE_NAME

When first time this job executed then it created a directory TABLE_NAME/2019-03-28 in hdfs and everything was fine.

But when I execute(on 2019-03-30) this job again with this same command then it did not create new sub-directory "2019-03-29" under "TABLE_NAME" directory.

I mean , it should create directory like TABLE_NAME/2019-03-29 but it did not create new directory according to date parameter and was appending incremental data to same directory i.e. TABLE_NAME/2019-03-28.

How should I resolve this issue?

Any help regarding this would be highly appreciated.

Note: I am using Apache Sqoop version 1.4.6