Incremental Sqoop on Dataproc gives "util.AppendUtils: Cannot append files to target dir; no such directory"

Viewed 230

I can run a full export of a postgresql table via a sqoop job on hadoop/google dataproc to export to a google storage bucket. But when I try an incremental export it fails.

gcloud dataproc jobs submit hadoop \
  --cluster="$CLUSTER_NAME" \
  --class=org.apache.sqoop.Sqoop \
  --properties=mapreduce.job.classloader=true \
  --jars="$UBER_JAR" \
  --region="$CLUSTER_REGION" \
  -- job --create "$job_name" \
  -- import \
  --connect="${CONNECTION_STRING}" \
  --username="${SOURCE_USER}" \
  --password="${SOURCE_PASSWORD}" \
  --target-dir="gs://$WAREHOUSE_BUCKET_NAME/${EXPORT_DIRNAME}/${job_name}" \
  --table="$table_name" \
  --as-avrodatafile \
  --incremental=append \
  --split-by="${split_by}" \
  --check-column created \
  --last-value "2017-01-01 00:00:00.000000" \
  --verbose

The logs indicate that it was able to export data, but nothing appears in the google storage bucket. I see the warning "util.AppendUtils: Cannot append files to target dir; no such directory":

...
20/03/13 20:52:18 INFO mapreduce.ImportJobBase: Transferred 4.6844 MB in 15.9306 seconds (301.106 KB/sec)
20/03/13 20:52:18 INFO mapreduce.ImportJobBase: Retrieved 27783 records.
20/03/13 20:52:18 DEBUG util.ClassLoaderStack: Restoring classloader: sun.misc.Launcher$AppClassLoader@7dc36524
20/03/13 20:52:18 WARN util.AppendUtils: Cannot append files to target dir; no such directory: _sqoop/df1bc552c9754b5aa2db3a6c04b03a75_insights_action
20/03/13 20:52:18 INFO tool.ImportTool: Incremental import complete! To run another incremental import of all data following this import, supply the following arguments:
20/03/13 20:52:18 INFO tool.ImportTool:  --incremental append
20/03/13 20:52:18 INFO tool.ImportTool:   --check-column created
20/03/13 20:52:18 INFO tool.ImportTool:   --last-value 2020-03-13 14:54:01.997784
20/03/13 20:52:18 INFO tool.ImportTool: (Consider saving this with 'sqoop job --create')
Job [1673b419f6c042d18dd8124f06e9c412] finished successfully.

Any idea if there's a workaround for this?

1 Answers

This is not an error just a warning, and should not lead to Sqoop job failure:

// This occurs if there was no source (tmp) dir. This might happen
// if the import was an HBase-target import, but the user specified
// --append anyway. This is a warning, not an error.
Related