Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st. We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here. Need help or have questions? Drop us a line at [email protected]
Created on 09-26-201710:20 PM - edited 08-17-201911:02 AM
Usually hive treats \n as newline character and everytime we ingest the data it will split single line into multiple lines depending on no of \n in the text.
For eg.
Step1: Create a table and try ingesting the data using insert into table command.
Step2: List the contents of table. We will observe that single line with '\n' in between is split in two lines.
Workaround
There are two ways to ingest data containing newline character
1. Using escape character
2. Using load data inpath command
Solution1: When we use escape character "\" with "\n", hive will ignore \n as newline but will treat it as string. (abcd\ndefg)