phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Istvan Toth (Jira)" <j...@apache.org>
Subject [jira] [Updated] (PHOENIX-6486) Phoenix uses JodaTime ISO calendar internally, which is incompatible with the JDK time representation
Date Mon, 31 May 2021 13:14:00 GMT

     [ https://issues.apache.org/jira/browse/PHOENIX-6486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Istvan Toth updated PHOENIX-6486:
---------------------------------
    Description: 
Phoenix does a lot of internal Time processing using JodaTime.
However, the default Chronology for JodaTime is ISO, 
while the default chronology used by the JDK is GregorianJulian 
https://www.joda.org/joda-time/cal_gj.html

This causes pre-cutover date handling to fail spectacularly:


{noformat}
> create table bubu (id integer primary key, ts timestamp);
1 row affected (0.059 seconds)
> upsert into bubu values (1, '1-1-1 0:0:0');
1 row affected (0.007 seconds)
> select * from bubu;
+----+-----------------------+
| ID |          TS           |
+----+-----------------------+
| 1  | 0001-01-03 01:00:00.0 |
+----+-----------------------+
1 row selected (0.014 seconds)
> select id, year(ts), month(ts), dayofmonth(ts), hour(ts), minute(ts), second(ts) from
bubu;
+----+----------+-----------+----------------+----------+------------+------------+
| ID | YEAR(TS) | MONTH(TS) | DAYOFMONTH(TS) | HOUR(TS) | MINUTE(TS) | SECOND(TS) |
+----+----------+-----------+----------------+----------+------------+------------+
| 1  | 1        | 1         | 1              | 0        | 0          | 0          |
+----+----------+-----------+----------------+----------+------------+------------+
1 row selected (0.014 seconds)
{noformat}


  was:
Phoenix does a lot of internal Time processing using JodaTime.
However, the default Chronology for JodaTime is ISO, 
while the default chronology used by the JDK is GregorianJulian 
https://www.joda.org/joda-time/cal_gj.html

This causes pre-cutover dates to completely handling to fail spectacularly:


{noformat}
> create table bubu (id integer primary key, ts timestamp);
1 row affected (0.059 seconds)
> upsert into bubu values (1, '1-1-1 0:0:0');
1 row affected (0.007 seconds)
> select * from bubu;
+----+-----------------------+
| ID |          TS           |
+----+-----------------------+
| 1  | 0001-01-03 01:00:00.0 |
+----+-----------------------+
1 row selected (0.014 seconds)
> select id, year(ts), month(ts), dayofmonth(ts), hour(ts), minute(ts), second(ts) from
bubu;
+----+----------+-----------+----------------+----------+------------+------------+
| ID | YEAR(TS) | MONTH(TS) | DAYOFMONTH(TS) | HOUR(TS) | MINUTE(TS) | SECOND(TS) |
+----+----------+-----------+----------------+----------+------------+------------+
| 1  | 1        | 1         | 1              | 0        | 0          | 0          |
+----+----------+-----------+----------------+----------+------------+------------+
1 row selected (0.014 seconds)
{noformat}



> Phoenix uses JodaTime ISO calendar internally, which is incompatible with the JDK time
representation 
> ------------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-6486
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6486
>             Project: Phoenix
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 5.1.1, 4.16.1
>            Reporter: Istvan Toth
>            Priority: Major
>
> Phoenix does a lot of internal Time processing using JodaTime.
> However, the default Chronology for JodaTime is ISO, 
> while the default chronology used by the JDK is GregorianJulian 
> https://www.joda.org/joda-time/cal_gj.html
> This causes pre-cutover date handling to fail spectacularly:
> {noformat}
> > create table bubu (id integer primary key, ts timestamp);
> 1 row affected (0.059 seconds)
> > upsert into bubu values (1, '1-1-1 0:0:0');
> 1 row affected (0.007 seconds)
> > select * from bubu;
> +----+-----------------------+
> | ID |          TS           |
> +----+-----------------------+
> | 1  | 0001-01-03 01:00:00.0 |
> +----+-----------------------+
> 1 row selected (0.014 seconds)
> > select id, year(ts), month(ts), dayofmonth(ts), hour(ts), minute(ts), second(ts)
from bubu;
> +----+----------+-----------+----------------+----------+------------+------------+
> | ID | YEAR(TS) | MONTH(TS) | DAYOFMONTH(TS) | HOUR(TS) | MINUTE(TS) | SECOND(TS) |
> +----+----------+-----------+----------------+----------+------------+------------+
> | 1  | 1        | 1         | 1              | 0        | 0          | 0          |
> +----+----------+-----------+----------------+----------+------------+------------+
> 1 row selected (0.014 seconds)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message