gpt4 book ai didi

hadoop - 非字符串值在 Hive 中显示为 NULL

转载 作者:行者123 更新时间:2023-12-02 20:14:54 25 4
gpt4 key购买 nike

我是 HIVE 的新手,正在创建我的第一张 table !
由于某种原因,所有非字符串值都显示为 NULL(包括 int、BOOLEAN 等)
我的数据看起来像这个示例行:

58;"management";"married";"tertiary";"no";2143;"yes";"no";"unknown";5;"may";261;1;-1;0;"unknown";"no"
我用它来创建表:
create external table bank_dataset(
age TINYINT,
job string,
education string,
default BOOLEAN,
balance INT,
housing BOOLEAN,
loan BOOLEAN,
contact STRING,
day STRING,
month STRING,
duration INT,
campaign INT,
pdays INT,
previous INT,
poutcome STRING,
y BOOLEAN)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u003B'
STORED AS TEXTFILE
location '/user/marchenrisaad_gmail/Bank_Project'
tblproperties("skip.header.line.count"="1");

最佳答案

感谢评论它的工作!但我有 1 个问题。对于每一行,我都正确获取了所有数据,然后我得到了额外的空值列。在我的代码下面找到:

create external table bank_dataset(age TINYINT, job string, education string, default BOOLEAN, balance INT, housing BOOLEAN, loan BOOLEAN, contact STRING,day INT, month STRING, duration INT,campaign INT, pdays INT, previous INT, poutcome STRING,y BOOLEAN)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
WITH SERDEPROPERTIES (
"separatorChar" = "\u003B",
"quoteChar" = '"'
)
STORED AS TEXTFILE
location '/user/marchenrisaad_gmail/Bank_Project'
tblproperties("skip.header.line.count"="1");
有什么建议么?

关于hadoop - 非字符串值在 Hive 中显示为 NULL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64545295/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com