hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject svn commit: r1033792 - in /hive/trunk: ./ ql/src/java/org/apache/hadoop/hive/ql/udf/generic/ serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/
Date Thu, 11 Nov 2010 01:14:37 GMT
Author: namit
Date: Thu Nov 11 01:14:37 2010
New Revision: 1033792

URL: http://svn.apache.org/viewvc?rev=1033792&view=rev
Log:
HIVE-1743 Compare from the end for GroupBy
(Siying Dong via namit)


Modified:
    hive/trunk/CHANGES.txt
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseCompare.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNotEqual.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPOr.java
    hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ListObjectsEqualComparer.java

Modified: hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hive/trunk/CHANGES.txt?rev=1033792&r1=1033791&r2=1033792&view=diff
==============================================================================
--- hive/trunk/CHANGES.txt (original)
+++ hive/trunk/CHANGES.txt Thu Nov 11 01:14:37 2010
@@ -232,6 +232,9 @@ Trunk -  Unreleased
     HIVE-1765 Add queryid while locking
     (namit via He Yongqiang)
 
+    HIVE-1743 Compare from the end for GroupBy
+    (Siying Dong via namit)
+
   OPTIMIZATIONS
 
   BUG FIXES

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseCompare.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseCompare.java?rev=1033792&r1=1033791&r2=1033792&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseCompare.java
(original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseCompare.java
Thu Nov 11 01:14:37 2010
@@ -43,7 +43,8 @@ import org.apache.hadoop.io.BooleanWrita
 @Description(name = "op", value = "a op b - Returns the result of operation")
 public abstract class GenericUDFBaseCompare extends GenericUDF {
   public enum CompareType {
-    // Now only string, int and bollean comparisons are treated as special cases.
+    // Now only string, text, int, long, byte and boolean comparisons are
+    // treated as special cases.
     // For other types, we reuse ObjectInspectorUtils.compare()
     COMPARE_STRING, COMPARE_TEXT, COMPARE_INT, COMPARE_LONG, COMPARE_BYTE,
     COMPARE_BOOL, SAME_TYPE, NEED_CONVERT
@@ -86,10 +87,10 @@ public abstract class GenericUDFBaseComp
       }
     }
 
-    if (TypeInfoUtils.getTypeInfoFromObjectInspector(arguments[0]) ==
-      TypeInfoFactory.stringTypeInfo &&
-      TypeInfoUtils.getTypeInfoFromObjectInspector(arguments[1]) ==
-        TypeInfoFactory.stringTypeInfo) {
+    if (TypeInfoUtils.getTypeInfoFromObjectInspector(arguments[0]).equals(
+      TypeInfoFactory.stringTypeInfo) &&
+      TypeInfoUtils.getTypeInfoFromObjectInspector(arguments[1]).equals(
+      TypeInfoFactory.stringTypeInfo)) {
       soi0 = (StringObjectInspector) arguments[0];
       soi1 = (StringObjectInspector) arguments[1];
       if (soi0.preferWritable() || soi1.preferWritable()) {

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNotEqual.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNotEqual.java?rev=1033792&r1=1033791&r2=1033792&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNotEqual.java
(original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPNotEqual.java
Thu Nov 11 01:14:37 2010
@@ -25,7 +25,7 @@ import org.apache.hadoop.hive.serde2.obj
 /**
  * GenericUDF Class for operation Not EQUAL.
  */
-@Description(name = "=", value = "a _FUNC_ b - Returns TRUE if a is not equal to b")
+@Description(name = "<>", value = "a _FUNC_ b - Returns TRUE if a is not equal to b")
 public class GenericUDFOPNotEqual extends GenericUDFBaseCompare {
   public GenericUDFOPNotEqual(){
     this.opName = "NOT EQUAL";

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPOr.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPOr.java?rev=1033792&r1=1033791&r2=1033792&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPOr.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPOr.java Thu Nov
11 01:14:37 2010
@@ -40,7 +40,7 @@ public class GenericUDFOPOr extends Gene
       throws UDFArgumentException {
     if (arguments.length != 2) {
       throw new UDFArgumentLengthException(
-          "The operator 'AND' only accepts 2 argument.");
+          "The operator 'OR' only accepts 2 argument.");
     }
     boi0 = (BooleanObjectInspector) arguments[0];
     boi1 = (BooleanObjectInspector) arguments[1];

Modified: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ListObjectsEqualComparer.java
URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ListObjectsEqualComparer.java?rev=1033792&r1=1033791&r2=1033792&view=diff
==============================================================================
--- hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ListObjectsEqualComparer.java
(original)
+++ hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ListObjectsEqualComparer.java
Thu Nov 11 01:14:37 2010
@@ -170,7 +170,7 @@ public class ListObjectsEqualComparer {
       return true;
     }
 
-    for (int i = 0; i < numFields; i++) {
+    for (int i = numFields - 1; i >= 0; i--) {
       if (!fieldComparers[i].areEqual(ol0.get(i), ol1.get(i))) {
         return false;
       }



Mime
View raw message