2017-05-20 28 views
0

我們可以在配置單元數據文件中使用引號(「或')作爲分隔符嗎?如果不是原因? 如果我們可以引用可用作分隔符的字符列表蜂房數據,那將是巨大Hive:在數據文件中使用引號字符作爲分隔符

+0

你爲什麼想這樣做somtehing這樣嗎? –

+0

@ Dudu:在我們的數據中,我們有各種可用作分隔符的字符組合,例如「\ t」,pipe(|)等。因此,我們想知道我們可以用於分隔符,並發現引號不出現在我們的數據中。 – Mrinal

+0

這聽起來像是一個不錯的選擇。如何對默認的Hive分隔符「SOH」(十進制值'1')或任何其他控制字符呢? –

回答

0

當使用十進制,您可以使用整個基本ASCII範圍(十進制0-127) - 。測試
避免使用\n\r

由於對於"',可以直接完成 -

create table mytable (i int,j int) row format delimited fields terminated by '"'; 
create table mytable (i int,j int) row format delimited fields terminated by "'"; 

create table mytable (i int,j int) row format delimited fields terminated by '\''; 
create table mytable (i int,j int) row format delimited fields terminated by "\""; 
相關問題