Hi,
I am trying to use hive windowing functions for a business use case. Hive
version is Apache Hive 0.11.
I have a table with a column end_date where value is 2999-12-31. While
using hive windowing function with this value, Hive is converting it to
1970s date.

*Query used is :*

SELECT account_id,
       device_id,
       status,
       LEAD (status) OVER (PARTITION BY device_id ORDER BY start_date DESC)
prev_status,
       start_date,
       end_date
from my_table;

*Sample data : *

  account_id  device_id  status  primary_min  start_date  end_date





 99999 1111111 2 1111111 2012-08-29 00:00:00  2013-08-14 00:00:00  99999
1111111 5 1111111 2013-08-15 00:00:00  2013-08-15 00:00:00  99999 1111111 4
1111111 2013-08-16 00:00:00  2013-11-30 00:00:00  99999 1111111 4
1111111 2013-12-01
00:00:00  2013-12-01 00:00:00  99999 1111111 4 1111111 2013-12-02
00:00:00 2014-01-15 00:00:00
99999 1111111 4 1111111 2014-01-16 00:00:00  2999-12-31 00:00:00

*Output : *

  account_id device_id status prev_status start_date end_date  99999 1111111
2 NULL 2012-08-29 00:00:00 2013-08-14 00:00:00  99999 1111111 5 2 2013-08-15
00:00:00 2013-08-15 00:00:00  99999 1111111 4 5 2013-08-16 00:00:00 2013-11-30
00:00:00  99999 1111111 4 4 2013-12-01 00:00:00 2013-12-01 00:00:00  99999
1111111 4 4 2013-12-02 00:00:00 2014-01-15 00:00:00  99999 1111111 4 4
2014-01-16
00:00:00 1979-03-26 23:28:00

Here, date 2999-12-31 got converted to 1979-03-26. I have tried converting
date type to String but not help.

Please let me know if anyone has faced same issue and resolved it.

Thanks in advance,

Akansha

Reply via email to