Hive
  1. Hive
  2. HIVE-2248

Comparison Operators convert number types to common type instead of double if possible

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.8.0
    • Component/s: Query Processor
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Now if the two sides of comparison is of different type, we always convert both to double and compare. It was a slight regression from the change in https://issues.apache.org/jira/browse/HIVE-1638. The old UDFOP<Comparison>, using GenericUDFBridge, always tried to find common type first.

      The worse case is this: If you did "WHERE <BIGINT_COLUMN> = 0 ", we always convert the column and 0 to double and compare, which is wasteful, though it is usually a minor costs in the system. But it is easy to fix.

        Activity

        Siying Dong created issue -
        Siying Dong made changes -
        Field Original Value New Value
        Description Now if the two sides of comparison is of different type, we always convert both to double and compare. It was a slight regression from the change in https://issues.apache.org/jira/browse/HIVE-1638. The old UDFOP<Comparison>, using GenericUDFBridge, always tried to find common type first. Now if the two sides of comparison is of different type, we always convert both to double and compare. It was a slight regression from the change in https://issues.apache.org/jira/browse/HIVE-1638. The old UDFOP<Comparison>, using GenericUDFBridge, always tried to find common type first.

        The worse case is this: If you did "WHERE <BIGINT_COLUMN> = 0 ", we always convert the column and 0 to double and compare, which is wasteful, though it is usually a minor costs in the system. But it is easy to fix.
        Siying Dong made changes -
        Attachment HIVE-2248.1.patch [ 12484838 ]
        Siying Dong made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Namit Jain added a comment -

        +1

        Show
        Namit Jain added a comment - +1
        Hide
        Namit Jain added a comment -

        Committed. Thanks Siying

        Show
        Namit Jain added a comment - Committed. Thanks Siying
        Namit Jain made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags [Reviewed]
        Resolution Fixed [ 1 ]
        Hide
        Hudson added a comment -

        Integrated in Hive-trunk-h0.21 #803 (See https://builds.apache.org/job/Hive-trunk-h0.21/803/)
        HIVE-2248 Comparison Operators convert number types to common type instead of
        double if necessary (Siying Dong via namit)

        namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1141777
        Files :

        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseCompare.java
        Show
        Hudson added a comment - Integrated in Hive-trunk-h0.21 #803 (See https://builds.apache.org/job/Hive-trunk-h0.21/803/ ) HIVE-2248 Comparison Operators convert number types to common type instead of double if necessary (Siying Dong via namit) namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1141777 Files : /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseCompare.java
        Carl Steinbach made changes -
        Fix Version/s 0.8.0 [ 12316178 ]
        Component/s Query Processor [ 12312586 ]
        Siying Dong made changes -
        Summary Comparison Operators convert number types to common type instead of double if necessary Comparison Operators convert number types to common type instead of double if possible
        Carl Steinbach made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Siying Dong
            Reporter:
            Siying Dong
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development