sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abhij...@apache.org
Subject git commit: SQOOP-598. Document NULL substitution string changes for HIVE import.
Date Mon, 10 Sep 2012 13:57:16 GMT
Updated Branches:
  refs/heads/trunk 2c16a2529 -> 2a2596b7d


SQOOP-598. Document NULL substitution string changes for HIVE import.

(Jarek Jarcec Cecho via Abhijeet Gaikwad)


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

Branch: refs/heads/trunk
Commit: 2a2596b7d5f3b7d8dfb13483a8010a32676e0dba
Parents: 2c16a25
Author: Abhijeet Gaikwad <abhijeet@apache.org>
Authored: Mon Sep 10 19:18:58 2012 +0530
Committer: Abhijeet Gaikwad <abhijeet@apache.org>
Committed: Mon Sep 10 19:18:58 2012 +0530

----------------------------------------------------------------------
 src/docs/user/hive.txt |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/2a2596b7/src/docs/user/hive.txt
----------------------------------------------------------------------
diff --git a/src/docs/user/hive.txt b/src/docs/user/hive.txt
index 69d6c7c..3dc8bb4 100644
--- a/src/docs/user/hive.txt
+++ b/src/docs/user/hive.txt
@@ -70,6 +70,18 @@ not set any delimiters and do use +\--hive-import+, the field delimiter
will
 be set to +^A+ and the record delimiter will be set to +\n+ to be consistent
 with Hive's defaults.
 
+Sqoop will by default import NULL values as string +null+. Hive is however
+using string +\N+ to denote +NULL+ values and therefore predicates dealing
+with +NULL+ (like +IS NULL+) will not work correctly. You should append
+parameters +\--null-string+ and +\--null-non-string+ in case of import job or
++--input-null-string+ and +--input-null-non-string+ in case of an export job if
+you wish to properly preserve +NULL+ values. Because sqoop is using those
+parameters in generated code, you need to properly escape value +\N+ to +\\N+:
+
+----
+$ sqoop import  ... --null-string '\\N' --null-non-string '\\N'
+----
+
 The table name used in Hive is, by default, the same as that of the
 source table. You can control the output table name with the +\--hive-table+
 option.


Mime
View raw message