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

DATE and TIMESTAMP comparisons do not work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 2.3.0
    • Hive
    • None

    Description

      When comparing a DATE type with a TIMESTAMP type, the planner promotes both sides to string. But since the DATE value does not include the hh:mm:ss[.nnnnnnnnn] the comparison produces wrong results.

      Thanks to Jason Dere for observing this.

      Here is a portion of an EXPLAIN output:

                            Map Join Operator
                              condition map:
                                   Inner Join 0 to 1
                              keys:
                                0 UDFToString(some_timestamp) (type: string)
                                1 UDFToString(some_date) (type: string)
      

      Workaround is to cast the DATE to a TIMESTAMP.

      Attachments

        Issue Links

          Activity

            People

              ashutoshc Ashutosh Chauhan
              mmccline Matt McCline
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: