HIVE是否接受CTRL字符?

时间:2017-02-08 16:52:29

标签: hive newline hiveql ddl

Hive是否接受'\r\n'终止的 CTRL 行?我必须为Windows生成一个文本文件,并希望使用CRLF进行行终止。如果是这样,你能否告诉我是否给出了正确的答案?

'\r\n'

终止的行

2 个答案:

答案 0 :(得分:0)

在配置单元documentation中,行分隔符为char,因此不应接受两个字符!

row_format   : DELIMITED 
    [FIELDS TERMINATED BY char [ESCAPED BY char]]
    [COLLECTION ITEMS TERMINATED BY char]
    [MAP KEYS TERMINATED BY char] [LINES TERMINATED BY char]
    [NULL DEFINED AS char] (Note: Only available starting with Hive 0.13)

答案 1 :(得分:0)

目前仅支持\n 看看这张JIRA门票。

演示

hive> create table t (i int) row format delimited lines terminated by '\r\n' location '/tmp';
FAILED: SemanticException 1:64 LINES TERMINATED BY only supports newline '\n' right now. Error encountered near token ''\r\n''
hive>