2015-03-31 45 views
4

我有以下輸入csv文件布爾列加載爲NULL

10418872, fever, FALSE 
10418872, shortness of breath, FALSE 
10418872, shortness of breath, FALSE 
10418872, shortness of breath, FALSE 

我創建使用這些命令和加載數據的一個蜂房表在它

create database bpo; 
CREATE EXTERNAL TABLE bpo.adverse(patientId INT, symptom STRING, severe BOOLEAN) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' STORED AS TEXTFILE LOCATION '/landingzone/hive/adverse'; 
LOAD DATA INPATH '/landingzone/adverse-effects.csv' INTO TABLE bpo.adverse; 

然而現在當我查詢配置單元中的數據

10418872   fever NULL 
10418872   shortness of breath NULL 
10418872   shortness of breath NULL 
10418872   shortness of breath NULL 

爲什麼布爾列變爲空?我也嘗試改變案例。

回答

1

請在FALSE之前修剪前導空格並嘗試。

我上述輸入測試如下,你可以看到在輸出的區別:

10418872, fever,FALSE 
10418872, shortness of breath,FALSE 
10418872, shortness of breath, FALSE 
10418872, shortness of breath, FALSE 

我得到的結果在蜂巢爲:

adverse.patientid adverse.symptom adverse.severe 
10418872   fever false 
10418872   shortness of breath false 
10418872   shortness of breath NULL 
10418872   shortness of breath NULL