hadoop-hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nzh...@apache.org
Subject svn commit: r965577 - in /hadoop/hive/trunk: ./ ql/src/java/org/apache/hadoop/hive/ql/exec/ serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/
Date Mon, 19 Jul 2010 18:31:49 GMT
Author: nzhang
Date: Mon Jul 19 18:31:49 2010
New Revision: 965577

URL: http://svn.apache.org/viewvc?rev=965577&view=rev
Log:
HIVE-1469. replace isArray() calls and remove LOG.isInfoEnabled() in Operator.forward()

Modified:
    hadoop/hive/trunk/CHANGES.txt
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/Operator.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/StandardListObjectInspector.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/StandardStructObjectInspector.java
    hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/UnionStructObjectInspector.java

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=965577&r1=965576&r2=965577&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Mon Jul 19 18:31:49 2010
@@ -31,6 +31,10 @@ Trunk -  Unreleased
     case
     (Siying Dong via Ning Zhang)
 
+    HIVE-1469. replace isArray() calls and remove LOG.isInfoEnabled() in 
+    Operator.forward()
+    (Yongqiang He via Ning Zhang)
+
   OPTIMIZATIONS
 
   BUG FIXES

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/Operator.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/Operator.java?rev=965577&r1=965576&r2=965577&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/Operator.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/Operator.java Mon Jul 19
18:31:49 2010
@@ -191,6 +191,7 @@ public abstract class Operator<T extends
   protected transient HashMap<Enum<?>, LongWritable> statsMap = new HashMap<Enum<?>,
LongWritable>();
   protected transient OutputCollector out;
   protected transient Log LOG = LogFactory.getLog(this.getClass().getName());
+  protected transient boolean isLogInfoEnabled = LOG.isInfoEnabled();
   protected transient String alias;
   protected transient Reporter reporter;
   protected transient String id;
@@ -665,7 +666,7 @@ public abstract class Operator<T extends
       }
     }
 
-    if (LOG.isInfoEnabled()) {
+    if (isLogInfoEnabled) {
       cntr++;
       if (cntr == nextCntr) {
         LOG.info(id + " forwarding " + cntr + " rows");

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/StandardListObjectInspector.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/StandardListObjectInspector.java?rev=965577&r1=965576&r2=965577&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/StandardListObjectInspector.java
(original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/StandardListObjectInspector.java
Mon Jul 19 18:31:49 2010
@@ -56,7 +56,7 @@ public class StandardListObjectInspector
     }
     // We support both List<Object> and Object[]
     // so we have to do differently.
-    boolean isArray = data.getClass().isArray();
+    boolean isArray = ! (data instanceof List);
     if (isArray) {
       Object[] list = (Object[]) data;
       if (index < 0 || index >= list.length) {
@@ -78,7 +78,7 @@ public class StandardListObjectInspector
     }
     // We support both List<Object> and Object[]
     // so we have to do differently.
-    boolean isArray = data.getClass().isArray();
+    boolean isArray = ! (data instanceof List);
     if (isArray) {
       Object[] list = (Object[]) data;
       return list.length;
@@ -94,7 +94,7 @@ public class StandardListObjectInspector
     }
     // We support both List<Object> and Object[]
     // so we have to do differently.
-    if (data.getClass().isArray()) {
+    if (! (data instanceof List)) {
       data = java.util.Arrays.asList((Object[]) data);
     }
     List<?> list = (List<?>) data;

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/StandardStructObjectInspector.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/StandardStructObjectInspector.java?rev=965577&r1=965576&r2=965577&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/StandardStructObjectInspector.java
(original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/StandardStructObjectInspector.java
Mon Jul 19 18:31:49 2010
@@ -135,7 +135,7 @@ public class StandardStructObjectInspect
     }
     // We support both List<Object> and Object[]
     // so we have to do differently.
-    boolean isArray = data.getClass().isArray();
+    boolean isArray = ! (data instanceof List);
     if (!isArray && !(data instanceof List)) {
       return data;
     }
@@ -170,7 +170,7 @@ public class StandardStructObjectInspect
     }
     // We support both List<Object> and Object[]
     // so we have to do differently.
-    if (data.getClass().isArray()) {
+    if (! (data instanceof List)) {
       data = java.util.Arrays.asList((Object[]) data);
     }
     List<Object> list = (List<Object>) data;

Modified: hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/UnionStructObjectInspector.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/UnionStructObjectInspector.java?rev=965577&r1=965576&r2=965577&view=diff
==============================================================================
--- hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/UnionStructObjectInspector.java
(original)
+++ hadoop/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/UnionStructObjectInspector.java
Mon Jul 19 18:31:49 2010
@@ -112,7 +112,7 @@ public class UnionStructObjectInspector 
     Object fieldData;
     // We support both List<Object> and Object[]
     // so we have to do differently.
-    if (data.getClass().isArray()) {
+    if (! (data instanceof List)) {
       Object[] list = (Object[]) data;
       assert (list.length == unionObjectInspectors.size());
       fieldData = list[f.structID];
@@ -133,7 +133,7 @@ public class UnionStructObjectInspector 
     }
     // We support both List<Object> and Object[]
     // so we have to do differently.
-    if (data.getClass().isArray()) {
+    if (! (data instanceof List)) {
       data = java.util.Arrays.asList((Object[]) data);
     }
     List<Object> list = (List<Object>) data;



Mime
View raw message