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

TRUNC of a Day and Hour is not fetching the expected output in Hive

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.1.0
    • 1.2.3
    • Hive
    • Cloudera

    • Incompatible change, Reviewed
    • TRUNC
    • Patch

    Description

      Trunc function for the Day and for an Hour is not fetching the expected result in Hive.

      However rest of the string units like 'MM', 'YYYY' works as expected

      I tried the below in Hive

      Query :
      SELECT TRUNC('2016-12-11 01:02:04','DD') FROM sample_08;

      SELECT TRUNC('2016-12-11 01:02:04','HH24') FROM sample_08;

      Result:
      NULL

      Expectation:
      Ideally it should be 2016-12-11 00:00:00 for day
      2016-12-11 01:00:00 for Hour

      Thanks,
      Vnoth R

      Attachments

        Activity

          People

            Unassigned Unassigned
            vinothsmart91 Vinoth Ragunathan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 96h
                96h
                Remaining:
                Remaining Estimate - 96h
                96h
                Logged:
                Time Spent - Not Specified
                Not Specified