[
https://issues.apache.org/jira/browse/HIVE-25499?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
zhaolong updated HIVE-25499:
----------------------------
Comment: was deleted
(was: [~ashish-kumar-sharma] Thank you for you reply.
And i also find another date problem in 3.1.2, do you know this problem.
I create a date type orc table in 1.2.1 version,
create table testdateorc(dt date);
insert into testdateorc values('0001-12-30');
select * from testdateorc; --> 0001-12-30
but when i download this orc file and load date into the same table in 3.1.2
version, it`s result is error.
create table testdateorc(dt date);
load data local inpath '/opt/000000_1' into table testdateorc;
select * from testdateorc; --> 0001-12-28
the orcfile writed in 1.2.1 is upload.
)
> select unix_timestamp(dt) from table and select unix_timestamp(constant date)
> are different
> --------------------------------------------------------------------------------------------
>
> Key: HIVE-25499
> URL: https://issues.apache.org/jira/browse/HIVE-25499
> Project: Hive
> Issue Type: Bug
> Affects Versions: 3.1.2
> Reporter: zhaolong
> Assignee: Ashish Sharma
> Priority: Major
> Attachments: 000000_0, image-2021-09-06-16-26-31-054.png
>
>
> I found select unix_timestamp(date column) from table and select
> unix_timestamp(constant date) are different in 3.1.2, for example:
> create table testdate(dt date);
> insert into testdate values('0001-12-30');
> select * from testdate; --> 0001-12-30
> select unix_timestamp(dt) from testdate; --> -62104233600
> select unix_timestamp('0001-12-30', 'yyyy-MM-dd'); --> -62104406400
> the -62104233600 is different with -62104406400.
>
> and convert timestap value is:
> select from_unixtime(-62104233600); --> 0002-01-01 00:00:00 , 62104233600 is
> select unix_timestamp(date column) from table value which date is 0001-12-30.
> select from_unixtime(-62104406400); --> 0001-12-30 00:00:00
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)