今天遇到个问题:

           利用java程序从云梯上读文件,解析出来的内容,会出现null,和\N。

 

1. 字符串null是因为,当字段=‘’时,存储为null。利用命令

        alter table adl_cici_test_fdt set serdeproperties('serialization.null.format' = '');

可是实现该功能。即遇到''用null替换

2.   那么\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

 

原来,当字段为NULL时,hdfs文件用\N表示。

相关文章:

  • 2022-12-23
  • 2021-12-17
  • 2021-06-14
  • 2021-05-09
  • 2021-11-16
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
猜你喜欢
  • 2021-04-25
  • 2021-08-23
  • 2022-12-23
  • 2021-11-18
  • 2021-12-09
  • 2021-05-20
相关资源
相似解决方案