Uh oh!
There was an error while loading. Please reload this page.
PHOENIX-6486 Phoenix uses inconsistent chronologies internally, break… - #1289
Conversation
stoty
commented
Aug 19, 2021
💔 -1 overall
This message was automatically generated. |
dbwong
commented
Aug 23, 2021
Question, likely we should follow what HBase/Hadoop does for storage/manipulation of temporal data. Does hbase use joda time internally or are they on only jdk, or another library? |
joshelser
commented
Aug 23, 2021
HBase doesn't have any notion of time (in this sense). The timestamp on an HBase cell is just a number. |
dbwong
commented
Aug 23, 2021
If we don't have any wire dependencies then any reason we are preferring jodatime? I think long term we likely would want to consider something more robust for SQL temporal standards for interval queries (like oracle BETWEEN) or perhaps more common like jdk8/jsr-310. @joshelser@richardantal |
stoty
commented
Aug 24, 2021
Unfortunately we cannot use JSR310, because it's only available from JDK8, and we still have to support JDK7 for 4.x. IMO the robustnes of Joda Time is not a problem, it's conceptually very similar to JSR310 (or rather the other way around), and actually has the same author. |
stoty
commented
Aug 24, 2021
@joshelser@dbwong |
stoty
commented
Aug 24, 2021
@richardantal Can you add some tests to see how this works with new java.time APIs and the conversions methods from/to java.sql.* ? |
dbwong
commented
Aug 24, 2021
Mmy comment on robustness was not pointing toward jodatime or jsr being more robust than another but rather in consideration of other datetime libraries from a future feature point of view as I know many SQL users have wanted in the past from my experience implementing many date time functions in other large databases. Apologies if I missed any library discussion on the JIRA but I mostly saw a great job covering the underlying currently used libraries and the time representation we were using. Maybe these were library discussions, thus class names, when I was assuming you were only discussing the calendar system. |
stoty
commented
Aug 24, 2021
@dbwong Yes, existing time data will be impacted. AFACT we only use JodaTime (with ISO chronology) in the write path, and we always read with the java.util.Date classes, and the current approach uses the java.util.Date compatible chronology for both read and write. However, some date/time functions do use Joda time internally, so the function output may be affected by the change, even if reading the values directly is not. I wouldn't worry about it too mach, as only pre-gregorian dates are affected, and the current mess makes using those impractical anyway. One issue with the approach in this patch is that we will need to re-implement GJChronology for the JSR310 migration, as it doesn't have that chronology by default. |
stoty
commented
Aug 24, 2021
To recap: In this patch we use GJChronology internally, so
If we used ISOChronology internally instead , then
(The above examples assume that the local TZ is UTC) So we will will behave unexpectedly in some cases either way, no matter what we do, there will be surprises when using either the old java.util.Date , or the new java.time.API . The current patch favors the old API. |
richardantal
commented
Aug 24, 2021
We had a private discussion about it with Istvan. Added a test with java.time API to visualise some scenario. Small correction about the current behaviour:
but
|
stoty
commented
Aug 24, 2021
💔 -1 overall
This message was automatically generated. |
…ing pre-Gregorian date handling
8d10198 to
fc09b11Comparerichardantal
commented
Aug 25, 2021
stoty
commented
Aug 25, 2021
💔 -1 overall
This message was automatically generated. |
…ing pre-Gregorian date handling