[
https://issues.apache.org/jira/browse/HIVE-16083?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15970713#comment-15970713
]
Anoop S Nair edited comment on HIVE-16083 at 4/17/17 6:22 AM:
--------------------------------------------------------------
Hi this issue is addressed by opencsv SERDE please find the same query below
and result
create table test_1(id int,name string)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
WITH SERDEPROPERTIES (
"separatorChar" = ",",
"quoteChar" = "'",
"escapeChar" = "\\"
)
stored as textfile;
insert into table test_1 values (1,'a,b,c');
hive> select * from test_1;
OK
1 a,b,c
now the results look good
was (Author: ilpane):
Hi this issue is addressed by opencsv SERDE please find the same query below
and result
create table test_1(id int,name string)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
WITH SERDEPROPERTIES (
"separatorChar" = "\t",
"quoteChar" = "'",
"escapeChar" = "\\"
)
stored as textfile;
insert into table test_1 values (1,'a,b,c');
hive> select * from test_1;
OK
1 a,b,c
now the results look good
> Hive should escape fields terminator when use textfile format
> -------------------------------------------------------------
>
> Key: HIVE-16083
> URL: https://issues.apache.org/jira/browse/HIVE-16083
> Project: Hive
> Issue Type: Bug
> Components: File Formats
> Affects Versions: 2.1.1
> Reporter: Winston Churchill
> Priority: Trivial
>
> Create table with comon as fields terminator and insert data contains comon:
> {code}
> create table test_1(id int,name string) row format delimited fields
> terminated by ',' stored as textfile;
> insert into table test_1 values (1,'a,b,c');
> {code}
> {code}
> select * from test_1;
> +------------+--------------+--+
> | test_1.id | test_1.name |
> +------------+--------------+--+
> | 1 | a |
> +------------+--------------+--+
> 4 rows selected (0.363 seconds)
> {code}
> May need to escape the fields terminator ?
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)