我试图用PIG减去两个日期。
我有这样的数据:
key_one, activation_date , deactivation_date
(1456,2010-06-14 00:00:00,2011-01-01 00:00:00)
(6524,2015-01-15 00:00:00,2015-02-07 00:00:00)
(1541,2010-07-17 00:00:00,2012-03-07 00:00:00)
我想在deactivation_date和activation_date之间设置日期差异,并在结果中接收' key_one'以及两个日期之间的日期'。
DATA_OUTPUT = foreach MY_DATA generate key_one,
DaysBetween(deactivation_date, activation_date) as days_between_two_dates;
后端错误:执行时出现异常[POUserFunc(名称:POUserFunc(org.apache.pig.builtin.DaysBetween)[long] - scope-231运算符键:scope-231)children:[]处的null:java。 lang.NullPointerException
任何想法,如何解决这个问题?