hive中的null值
来源:互联网 发布:java 中英文字符长度 编辑:程序博客网 时间:2024/04/26 07:27
所以需要通过serialization.null.format的设置来修改表的默认的null表示方式。
测试表
hive> select * from sunwg00;
OK
NULL mary
101 tom
Time taken: 0.058 seconds
创建普通表sunwg01,没有指定serialization.null.format
hive> CREATE TABLE sunwg01 (id int,name STRING) STORED AS TEXTFILE;
OK
Time taken: 0.04 seconds
hive> insert overwrite table sunwg01 select * from sunwg00;
Loading data to table sunwg01
2 Rows loaded to sunwg01
OK
Time taken: 17.047 seconds
查看sunwg01在hdfs的文件
[hjl@sunwg src]$ hadoop fs -cat /hjl/sunwg01/attempt_201105020924_0011_m_000000_0
/Nmary
101tom
NULL值被转写成’/N’
创建表sunwg02,指定serialization.null.format
hive> CREATE TABLE sunwg02 (id int,name STRING)
> ROW FORMAT SERDE ‘org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe’
> WITH SERDEPROPERTIES (
> ‘field.delim’='/t’,
> ‘escape.delim’='//’,
> ‘serialization.null.format’=”
> ) STORED AS TEXTFILE;
OK
Time taken: 0.046 seconds
hive> insert overwrite table sunwg02 select * from sunwg00;
Loading data to table sunwg02
2 Rows loaded to sunwg02
OK
Time taken: 18.756 seconds
查看sunwg02在hdfs的文件
[hjl@sunwg src]$ hadoop fs -cat /hjl/sunwg02/attempt_201105020924_0013_m_000000_0
mary
101 tom
NULL值没有被转写成’/N’,而是空字符串。
- hive中的null值
- hive中的null值
- hive中的NULL(hive空值处理)
- hive中的NULL(hive空值处理)
- hive中的NULL(hive空值处理)
- hive中的NULL分析
- hive 中的NULL测试
- hive中的NULL分析
- hive 中的null
- Hive中的NULL问题
- Hive中的一种假NULL
- Hive中的一种假NULL
- HIVE NULL 值
- HIVE NULL 值处理
- hive 空值、NULL判断
- hive 空值、null判断
- hive null
- hive null
- About IDE
- 是时候了
- linux设备驱动归纳总结(一):内核的相关基础概念
- hdu 1465 不容易系列之一
- Eclipse启动计时插件
- hive中的null值
- Kth Smallest Element in a BST
- I2C总线之(二)---时序
- 论坛自动回复
- 1458 Common Subsequence【lcs】
- 博弈题集
- Task schedule
- poj 1458 Common Subsequence (LCS(最长公共子序列))
- 清理oracle预警的警告信息