- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Created on 09-26-2017 10:20 PM - edited 08-17-2019 11: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)
querying the table
Solution 2: Using "load data inpath" command.
Step1: Upload the file on HDFS
Step2: Load data from file to table
Created on 11-07-2018 01:31 PM
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thanks for this @rchaman
Do you have a best practice suggestion for for \n ingestion via SAS - via libname?