I am trying to create an external hive table off a directory of files using csvserde that is delimited by the hexadecimal value 1F. The csvserde works fine on regular comma delimited. I am not sure how to express the hexadecimal value in the seperator.
CREATE EXTERNAL TABLE example_table(
id bigint,
property_id string,
application_date date,
system_time timestamp,
system_end timestamp
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
WITH SERDEPROPERTIES(
"separatorChar" = "\1F"
)
STORED AS
TEXTFILE
LOCATION '/user/nameofdirectory'
解决方案
The seperatorChar should be expressed in octal value.
In this case the delimiter was 1f in hexadecimal (31 decimal equivalent).
In octal, it is 037. So the seperatorChar should be "\037"