今天我们有一个问题:
[En]
We have a problem today:
用Java程序从梯子上读取文件,解析内容,就会有空,和N。
[En]
Use the java program to read the file from the ladder, parse the content, there will be null, and N.
- 字符串null是因为,当字段=”时,存储为null。利用命令
alter table adl_cici_test_fdt set serdeproperties(‘serialization.null.format’ = ”);
但要实现这一功能。也就是说,当您遇到‘’时,替换为NULL。
[En]
But to achieve this function. That is to say, when you encounter”, replace with null.
- 那么\N是什么呢?
于是select id,name,age,address from adl_cici_test_fdt where pt=20130910 limit 50; 查询结果为:
id name age address 1 Lily 18 null 2 Mike 24 NULL
最初,当该字段为空时,HDFS文件由N表示。
[En]
Originally, when the field is NULL, the hdfs file is represented by N.
Original: https://www.cnblogs.com/0xcafedaddy/p/9553986.html
Author: 0xcafedaddy
Title: hive表中字段显示为NULL时,HDFS文件中存储为N
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/6859/
转载文章受原作者版权保护。转载请注明原作者出处!