我应该如何在 RegexSerDe 中使用 NULL 值?我有数据文件:
cat MOS/ex1.txt
123,dwdjwhdjwh,456
543,\N,956
我有桌子:
CREATE TABLE mos.stations (usaf string, wban STRING, name string)
ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.RegexSerDe'
WITH SERDEPROPERTIES (
"input.regex" = "(.*),(.*),(.*)"
);
我成功地将数据从文件加载到表:
LOAD DATA LOCAL INPATH '/home/hduser/MOS/ex1.txt' OVERWRITE INTO TABLE mos.stations;
简单的选择工作正常:
hive> select * from mos.stations;
123dwdjwhdjwh456
543\N956
接下来以错误结束:
select * from mos.stations where wban is null;
[Hive Error]: Query returned non-zero code: 9, cause: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.MapRedTask
怎么了?