我正在尝试通过设置属性'serialization.null.format' = ''
,将源文件中的空值转换为hive表中的NULL。 我在hive中编写的查询如下:
create table test(a int, b string) stored as parquet TBLPROPERTIES('serialization.null.format'='');
然后通过Impala将值插入其中,类似于这样:
insert overwrite table test values (1, ''), (2, 'b');
这个结果显示的内容如下:
| a | b |
| 1 | |
| 2 | b |
“有人能帮我解决一下,为什么空格不能转换为 NULL 吗?”