Review Board 1.7.22


Review request for SQOOP-883: Adds a --delete-target-dir option

Review Request #11517 - Created May 29, 2013 and submitted

Raghav Gautam
Reviewers
Sqoop
sqoop-trunk
After first import, re-importing to a directory fails because the directory already exists. This patch tries to fix that by providing a --delete-target-dir option. This option will delete the target directory of the import before running the import if it exists.
Added new test for the option.
All the tests pass.
src/docs/user/import.txt
Revision 4a9a316 New Change
[20] 59 lines
[+20]
60
+\--as-avrodatafile+              Imports data to Avro Data Files
60
+\--as-avrodatafile+              Imports data to Avro Data Files
61
+\--as-sequencefile+              Imports data to SequenceFiles
61
+\--as-sequencefile+              Imports data to SequenceFiles
62
+\--as-textfile+                  Imports data as plain text (default)
62
+\--as-textfile+                  Imports data as plain text (default)
63
+\--boundary-query <statement>+   Boundary query to use for creating splits
63
+\--boundary-query <statement>+   Boundary query to use for creating splits
64
+\--columns <col,col,col...>+     Columns to import from table
64
+\--columns <col,col,col...>+     Columns to import from table

    
   
65
+\--delete-target-dir+            Delete the import target directory\

    
   
66
                                  if it exists
65
+\--direct+                       Use direct import fast path
67
+\--direct+                       Use direct import fast path
66
+\--direct-split-size <n>+        Split the input stream every 'n' bytes\
68
+\--direct-split-size <n>+        Split the input stream every 'n' bytes\
67
                                  when importing in direct mode
69
                                  when importing in direct mode
68
+\--fetch-size <n>+               Number of entries to read from database\
70
+\--fetch-size <n>+               Number of entries to read from database\
69
                                  at once.
71
                                  at once.
[+20] [20] 664 lines
src/java/org/apache/sqoop/SqoopOptions.java
Revision 4be6a6a New Change
 
src/java/org/apache/sqoop/tool/BaseSqoopTool.java
Revision 01a55e5 New Change
 
src/java/org/apache/sqoop/tool/ImportTool.java
Revision 1c57503 New Change
 
src/test/com/cloudera/sqoop/TestSqoopOptions.java
Revision c78cd87 New Change
 
src/test/com/cloudera/sqoop/mapreduce/TestImportJob.java
Revision 6ab3b82 New Change
 
  1. src/docs/user/import.txt: Loading...
  2. src/java/org/apache/sqoop/SqoopOptions.java: Loading...
  3. src/java/org/apache/sqoop/tool/BaseSqoopTool.java: Loading...
  4. src/java/org/apache/sqoop/tool/ImportTool.java: Loading...
  5. src/test/com/cloudera/sqoop/TestSqoopOptions.java: Loading...
  6. src/test/com/cloudera/sqoop/mapreduce/TestImportJob.java: Loading...