Create HIVE Table with multi character delimiter
hadoop, hive
Solution
`FILELDS TERMINATED BY` does not support multi-character delimiters. The easiest way to do this is to use `RegexSerDe`:
CREATE EXTERNAL TABlE tableex(id INT, name STRING)
ROW FORMAT 'org.apache.hadoop.hive.contrib.serde2.RegexSerDe'
WITH SERDEPROPERTIES (
"input.regex" = "^(\\d+)~\\*(.*)$"
)
STORED AS TEXTFILE
LOCATION '/user/myusername';
Problem
I want to create a HIVE Table with multi string character as a delimiter such as ``` CREATE EXTERNAL TABlE tableex(id INT, name STRING) ROW FORMAT delimited fields terminated by ',' LINES TERMINATED BY '\n' STORED AS TEXTFILE LOCATION '/user/myusername'; ``` I want to have delimiter as a multi string like "~*".