Database Reference
In-Depth Information
When we created the zip_profits table in Hive, we did not specify any delimiters. So
Hive used its default delimiters: a Ctrl-A character (Unicode 0x0001 ) between fields and
a newline at the end of each record. When we used Hive to access the contents of this
table (in a SELECT statement), Hive converted this to a tab-delimited representation for
display on the console. But when reading the tables directly from files, we need to tell
Sqoop which delimiters to use. Sqoop assumes records are newline-delimited by default,
but needs to be told about the Ctrl-A field delimiters. The --input-fields-
terminated-by argument to sqoop export specified this information. Sqoop sup-
ports several escape sequences, which start with a backslash (\) character, when specifying
delimiters.
In the example syntax, the escape sequence is enclosed in single quotes to ensure that the
shell processes it literally. Without the quotes, the leading backslash itself may need to be
escaped (e.g., --input-fields-terminated-by \\0001 ). The escape se-
quences supported by Sqoop are listed in Table 15-1 .
Search WWH ::




Custom Search