Created 11-16-2016 12:17 PM
EDIT: FIELDS TERMINATED BY '\u0059' WORKS
I am trying to create an external table from a csv file with ; as delimiter. I have tried
FIELDS TERMINATED BY ';' FIELDS TERMINATED BY '\;' FIELDS TERMINATED BY '\\;'
Modifying the data is not an option.
This is the hive script:
CREATE EXTERNAL TABLE table1(
f STRING
)
COMMENT 'table 1'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\;'
STORED AS TEXTFILE
LOCATION '/path/to/hdfs/'
tblproperties ("skip.header.line.count"="1");I get the following error, in all cases:
Error while compiling statement: FAILED: ParseException line 72:23 mismatched input '<EOF>' expecting StringLiteral near 'BY' in table row format's field separator [ERROR_STATUS]
Created 11-16-2016 12:28 PM
Created 11-16-2016 12:28 PM
Nevermind: this does work
FIELDS TERMINATED BY '\u0059'
Created 11-16-2016 12:40 PM
Check this,
FIELDS TERMINATED BY ';'
Created 11-16-2016 12:48 PM
This is exactly what is causing the error.... Hive thinks the ; ends the statement, despite the quotes
Created 11-02-2017 02:39 PM
FIELDS TERMINATED BY '\u003B'