Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1832

DateTimeUtils dateString to Unix translation error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Bug
    • 1.10.0
    • 1.13.0
    • avatica
    • None

    Description

      Using the latest snapshot of Calcite, one of the Apache Flink Test fails. The failure is due to an error in CAST, that relies on Avatica DateTimeUtils.

      I have implemented a simple class test:

      public class Test 
      {
          public static void main( String[] args )
          {
             int dateInt = DateTimeUtils.dateStringToUnixDate("1500-03-04");
             System.out.println(dateInt);
             System.out.println(DateTimeUtils.unixDateToString(dateInt));
             
          }
      }
      

      and the output is:

      -171592
      1500-03-14
      

      it adds an offset of 10 days for some reason.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              stefano.bortoli Stefano Bortoli
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: