From 2a2596b7d5f3b7d8dfb13483a8010a32676e0dba Mon Sep 17 00:00:00 2001 From: Abhijeet Gaikwad Date: Mon, 10 Sep 2012 19:18:58 +0530 Subject: [PATCH] SQOOP-598. Document NULL substitution string changes for HIVE import. (Jarek Jarcec Cecho via Abhijeet Gaikwad) --- src/docs/user/hive.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/docs/user/hive.txt b/src/docs/user/hive.txt index 69d6c7c0..3dc8bb46 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.