csv - 从 CSV 文件加载数据时配置单元中 INT 列的空值
问题描述
当我将 csv 文件中的数据加载到 hive 表中时,除字符串头之外的所有 int 头都显示为空。
我有 pokemon.csv 文件,其列标题如下
# Name Type 1 Type 2 Total HP Attack Defense Sp. Atk Sp. Def Speed
1 Bulbasaur Grass Poison 318 45 49 49 65 65 45
2 Ivysaur Grass Poison 405 60 62 63 80 80 60
3 Venusaur Grass Poison 525 80 82 83 100 100 80
我有如下表
CREATE TABLE pokemon (
Number Int,
Name String,
Type1 String,
Type2 String,
Total Int,
HP Int,
Attack Int,
Defense Int,
Sp_Atk Int,
Sp_Def Int,
Speed Int
)
row format delimited
fields terminated BY ','
lines terminated BY '\n'
tblproperties("skip.header.line.count"="1");
我得到如下结果
hive> select * from pokemon limit 2;
OK
NULL Name Type 1 Type 2 NULL NULL NULL NULL NULL NULL NULL
1 Bulbasaur Grass Poison 318 45 49 49 65 65 45
Time taken: 0.163 seconds
不知道为什么我只为 INT 列获取 NULL 标题。请问有人可以帮忙吗?
解决方案
推荐阅读
- swift - 类实例的内存访问
- javascript - 尝试使用 document.queryselector 将事件侦听器添加到 onclick 事件不起作用
- php - 在 CakePhp 3.x 上将 Value 更新为 null
- python - 在 python 中用阴影区域绘制 95% 置信区间线图
- javascript - 在 normalizr 中重命名结果属性
- c# - 如何从 SQL 数据库获取整数值到 Windows 窗体(C#)中的变量?
- r - r中的if,else语句问题
- javascript - 脚本如何计算包含 json 数据中指定频率的对象
- swift - 如何在没有 ARHitTest 的情况下将 AR 对象放置在平面上?
- sql-server - laravel 连接 sql server 和 windows 身份验证