Sqoop tutorial 11: Handling NULL Values


You can override the NULL substitution string with the --null-string and --null-nonstring parameters to any arbitrary value. 

For example, use the following command to override it to \N:

sqoop import \
--connect jdbc:mysql://mysql.example.com/sqoop \
--username sqoop \
--password sqoop \
--table cities \
--null-string '\\N' \
--null-non-string '\\N'

1. --null-string argument represents what should be writtern in HDFS whenever a NULL is identified in column defined as string in relational database.
2. --null-non-string argument works similar to --null-string argument except that it work on columns defined as non-string in relational database.

Comments

Popular posts from this blog

Hive Tutorial 31 : Analytic Functions

Hive Tutorial 37 : Performance Tuning

How to change sqoop saved job parameters