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

        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
        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

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development