Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-1051

Casting timestamp as date gives wrong result for dates earlier than 1883

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      #Wed Jun 18 10:27:23 PDT 2014
      git.commit.id.abbrev=894037a

      It appears casting dates earlier than year 1797 gives wrong result:

      0: jdbc:drill:schema=dfs> select cast(c_timestamp as varchar(20)), cast(c_timestamp as date) from data where c_row <> 12;
      ----------------------+

      EXPR$0 EXPR$1

      ----------------------+

      1997-01-02 03:04:05 1997-01-02
      1997-01-02 00:00:00 1997-01-02
      2001-09-22 18:19:20 2001-09-22
      1997-02-10 17:32:01 1997-02-10
      1997-02-10 17:32:00 1997-02-10
      1997-02-11 17:32:01 1997-02-11
      1997-02-12 17:32:01 1997-02-12
      1997-02-13 17:32:01 1997-02-13
      1997-02-14 17:32:01 1997-02-14
      1997-02-15 17:32:01 1997-02-15
      1997-02-16 17:32:01 1997-02-16
      0097-02-16 17:32:01 0097-02-17
      0597-02-16 17:32:01 0597-02-13
      1097-02-16 17:32:01 1097-02-09
      1697-02-16 17:32:01 1697-02-15
      1797-02-16 17:32:01 1797-02-15
      1897-02-16 17:32:01 1897-02-16
      1997-02-16 17:32:01 1997-02-16
      2097-02-16 17:32:01 2097-02-16
      1996-02-28 17:32:01 1996-02-28
      1996-02-29 17:32:01 1996-02-29
      1996-03-01 17:32:01 1996-03-01

      ----------------------+
      22 rows selected (0.201 seconds)

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            vitalii Vitalii Diravka
            cchang@maprtech.com Chun Chang
            Chun Chang Chun Chang
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment