Skip to content

Instantly share code, notes, and snippets.

@chhantyal
Last active February 11, 2019 11:31
Show Gist options
  • Save chhantyal/38662a527fa9ac7bb5a09af3bebed660 to your computer and use it in GitHub Desktop.
Save chhantyal/38662a527fa9ac7bb5a09af3bebed660 to your computer and use it in GitHub Desktop.
Hive create external table from CSV file with semicolon as delimiter
/* Semicolon (;) is used as query completion in Hive */
/* Thus, using TERMINATED BY ";" will not work. This is workaround to that limitation */
CREATE EXTERNAL TABLE tablename
(`col1` string, `col2` string)
ROW FORMAT DELIMITED FIELDS TERMINATED BY "\u003B" STORED AS TEXTFILE
LOCATION "<location>"
TBLPROPERTIES("skip.header.line.count"="1");
@yimapingchuanto
Copy link

useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment