sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject git commit: SQOOP-832: Document --columns argument usage in export tool
Date Fri, 11 Jul 2014 03:39:20 GMT
Repository: sqoop
Updated Branches:
  refs/heads/trunk efda8ddca -> d46833b64


SQOOP-832: Document --columns argument usage in export tool

(Qian Xu via Jarek Jarcec Cecho)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/d46833b6
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/d46833b6
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/d46833b6

Branch: refs/heads/trunk
Commit: d46833b64682be32ae860a05bd19ba9d33da0142
Parents: efda8dd
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Thu Jul 10 20:38:54 2014 -0700
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Thu Jul 10 20:38:54 2014 -0700

----------------------------------------------------------------------
 src/docs/man/sqoop-export.txt |  3 +++
 src/docs/user/export.txt      | 22 ++++++++++++++++++----
 2 files changed, 21 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/d46833b6/src/docs/man/sqoop-export.txt
----------------------------------------------------------------------
diff --git a/src/docs/man/sqoop-export.txt b/src/docs/man/sqoop-export.txt
index 9698525..8c46737 100644
--- a/src/docs/man/sqoop-export.txt
+++ b/src/docs/man/sqoop-export.txt
@@ -27,6 +27,9 @@ include::common-args.txt[]
 Export control options
 ~~~~~~~~~~~~~~~~~~~~~~
 
+--columns (col-names)::
+  Columns to export to table
+
 --direct::
   Use direct import fast path (MySQL)
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/d46833b6/src/docs/user/export.txt
----------------------------------------------------------------------
diff --git a/src/docs/user/export.txt b/src/docs/user/export.txt
index 304810a..72d751b 100644
--- a/src/docs/user/export.txt
+++ b/src/docs/user/export.txt
@@ -48,6 +48,7 @@ include::validation-args.txt[]
 `----------------------------------------`------------------------------
 Argument                                 Description
 ------------------------------------------------------------------------
++\--columns <col,col,col...>+            Columns to export to table
 +\--direct+                              Use direct export fast path
 +\--export-dir <dir>+                    HDFS source path for the export
 +-m,\--num-mappers <n>+                  Use 'n' map tasks to export in\
@@ -77,9 +78,18 @@ Argument                                 Description
 ------------------------------------------------------------------------
 
 The +\--export-dir+ argument and one of +\--table+ or +\--call+ are
- required. These specify the table to populate in the database (or the
- stored procedure to call), and the directory in HDFS that contains
- the source data.
+required. These specify the table to populate in the database (or the
+stored procedure to call), and the directory in HDFS that contains
+the source data.
+
+By default, all columns within a table are selected for export. You
+can select a subset of columns and control their ordering by using the
++\--columns+ argument. This should include a comma-delimited list
+of columns to export. For example: +\--columns "col1,col2,col3"+. Note
+that columns that are not included in the +--columns+ parameter need
+to have either defined default value or allow +NULL+ values. Otherwise
+your database will reject the imported data which in turn will make 
+Sqoop job fail.
 
 You can control the number of mappers independently from the number of
 files present in the directory. Export performance depends on the
@@ -266,6 +276,11 @@ Sqoop attempts to insert rows which violate constraints in the database
 (for example, a particular primary key value already exists), then the export
 fails.
 
+Alternatively, you can specify the columns to be exported by providing
++--columns "col1,col2,col3"+. Please note that columns that are not included
+in the +--columns+ parameter need to have either defined default value or 
+allow +NULL+ values. Otherwise your database will reject the imported data 
+which in turn will make Sqoop job fail.
 
 Another basic export to populate a table named +bar+ with validation enabled:
 <<validation,More Details>>
@@ -282,4 +297,3 @@ An export that calls a stored procedure named +barproc+ for every record
in
 $ sqoop export --connect jdbc:mysql://db.example.com/foo --call barproc \
     --export-dir /results/bar_data
 ----
-


Mime
View raw message