- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
how to load double quotes data of fields in hive table?
- Labels:
-
Apache Hive
Created ‎09-18-2017 11:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
am having csv file data like this as shown below
example
1,"Air Transport International, LLC",example,city |
i have to load this data in hive like this as shown below
1,Air Transport InternationalLLC,example,city
but actually am getting like below??
1,Air Transport International, LLC,example,city
how to solve this problem
please give me solution
thanks with regards,
swathi.T
Created ‎09-18-2017 02:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@swathi thukkaraju,
You can use the below serde properties to read your data correctly
CREATE TABLE test(a string, b string,..) ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde' WITH SERDEPROPERTIES ( "separatorChar" = ",", "quoteChar" = "\"" ) STORED AS TEXTFILE location 'location of csv file';
Created ‎09-18-2017 01:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use the CSV SerDe: https://cwiki.apache.org/confluence/display/Hive/CSV+Serde
This has support for quoted cells.
Please refer to the general SerDe documentation if you have questions on how to use SerDe's:
https://cwiki.apache.org/confluence/display/Hive/DeveloperGuide#DeveloperGuide-HiveSerDe
Created ‎09-18-2017 02:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@swathi thukkaraju,
You can use the below serde properties to read your data correctly
CREATE TABLE test(a string, b string,..) ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde' WITH SERDEPROPERTIES ( "separatorChar" = ",", "quoteChar" = "\"" ) STORED AS TEXTFILE location 'location of csv file';
Created ‎01-08-2018 05:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does it support load gzipped csv file? I got `FAILED: SemanticException Unable to load data to destination table. Error: The file that you are trying to load does not match the file format of the destination table.`
