Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-25458

unix_timestamp() with string input give wrong result

    XMLWordPrintableJSON

Details

    Description

      Description -

      unix_timestamp() accept 4 value string/date/timestamp/timestamptz. Out of which date/timestamp/timestamptz use DateTimeFormatter.class where as string type use SimpleDateTimeformatter.class which cause difference is value.

      Example -
      select from_unixtime(unix_timestamp('1800-11-08 01:53:11'));
      1800-11-08 01:35:15

      select from_unixtime(unix_timestamp(cast('1800-11-08 01:53:11' as timestamp)));
      1800-11-08 01:53:11

      Attachments

        Issue Links

          Activity

            People

              ashish-kumar-sharma Ashish Sharma
              ashish-kumar-sharma Ashish Sharma
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 20m
                  2h 20m