Hive
  1. Hive
  2. HIVE-3850

hour() function returns 12 hour clock value when using timestamp datatype

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.0, 0.10.0
    • Fix Version/s: 0.11.0
    • Component/s: UDF
    • Labels:
      None

      Description

      Apparently UDFHour.java does have two evaluate() functions. One that does accept a Text object as parameter and one that does use a TimeStampWritable object as parameter. The first function does return the value of Calendar.HOUR_OF_DAY and the second one of Calendar.HOUR. In the documentation I couldn't find any information on the overload of the evaluation function. I did spent quite some time finding out why my statement didn't return a 24 hour clock value.

      Shouldn't both functions return the same?

      1. hive-3850_1.patch
        2 kB
        Anandha L Ranganathan
      2. HIVE-3850.patch.txt
        0.5 kB
        Frankline Jose S

        Activity

        Pieterjan Vriends created issue -
        Pieterjan Vriends made changes -
        Field Original Value New Value
        Summary hour() function returns 12 hour clock value when using timestamp datatype. hour() function returns 12 hour clock value when using timestamp
        Pieterjan Vriends made changes -
        Priority Minor [ 4 ] Major [ 3 ]
        Pieterjan Vriends made changes -
        Affects Version/s 0.9.0 [ 12317742 ]
        Pieterjan Vriends made changes -
        Description Apparently UDFHour.java does have two evaluate() functions. One that does accept a Text object as parameter and one that does use a TimeStampWritable object as parameter. The first function does return the value of Calendar.HOUR_OF_DAY and the second one of Calendar.HOUR. In the documentation I couldn't find any information on the overload of the evaluation function. I did spent quite some time finding out why my statement didn't return a 24 hour clock value.
        Apparently UDFHour.java does have two evaluate() functions. One that does accept a Text object as parameter and one that does use a TimeStampWritable object as parameter. The first function does return the value of Calendar.HOUR_OF_DAY and the second one of Calendar.HOUR. In the documentation I couldn't find any information on the overload of the evaluation function. I did spent quite some time finding out why my statement didn't return a 24 hour clock value.

        Shouldn't both functions return the same?
        Pieterjan Vriends made changes -
        Summary hour() function returns 12 hour clock value when using timestamp hour() function returns 12 hour clock value when using timestamp datatype
        Pieterjan Vriends made changes -
        Issue Type Improvement [ 4 ] Bug [ 1 ]
        Frankline Jose S made changes -
        Attachment HIVE-3850.patch.txt [ 12566944 ]
        Pieterjan Vriends made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Mark Grover made changes -
        Fix Version/s 0.11.0 [ 12323587 ]
        Affects Version/s 0.10.0 [ 12320745 ]
        Mark Grover made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Anandha L Ranganathan made changes -
        Attachment hive-3850.patch [ 12568713 ]
        Anandha L Ranganathan made changes -
        Status Reopened [ 4 ] Patch Available [ 10002 ]
        Anandha L Ranganathan made changes -
        Attachment hive-3850.patch [ 12568713 ]
        Anandha L Ranganathan made changes -
        Attachment hive-3850.patch [ 12571348 ]
        Anandha L Ranganathan made changes -
        Attachment hive-3850.patch [ 12571348 ]
        Anandha L Ranganathan made changes -
        Attachment hive-3850.patch_1.txt [ 12571349 ]
        Anandha L Ranganathan made changes -
        Attachment hive-3850.patch_1.txt [ 12571349 ]
        Anandha L Ranganathan made changes -
        Attachment hive-3850_1.patch [ 12571351 ]
        Ashutosh Chauhan made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Owen O'Malley made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Pieterjan Vriends
          • Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development