Why sqoop job is not creating dynamic sub-directory date wise?

喜你入骨 提交于 2020-01-06 08:36:06

问题


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

来源:https://stackoverflow.com/questions/55427694/why-sqoop-job-is-not-creating-dynamic-sub-directory-date-wise

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!