Author: vikram
Date: Wed Feb 19 02:50:09 2014
New Revision: 1569619

URL: http://svn.apache.org/r1569619
Log:
HIVE-6326: Split generation in ORC may generate wrong split boundaries because 
of unaccounted padded bytes (Prasanth J via Vikram Dixit K)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java

Modified: 
hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java
URL: 
http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java?rev=1569619&r1=1569618&r2=1569619&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java 
(original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java 
Wed Feb 19 02:50:09 2014
@@ -729,7 +729,10 @@ public class OrcInputFormat  implements 
           idx++;
 
           // eliminate stripes that doesn't satisfy the predicate condition
-          if (sarg != null && !isStripeSatisfyPredicate(stripeStats.get(idx), 
sarg, filterColumns)) {
+          if (sarg != null &&
+              stripeStats != null &&
+              idx < stripeStats.size() &&
+              !isStripeSatisfyPredicate(stripeStats.get(idx), sarg, 
filterColumns)) {
 
             // if a stripe doesn't satisfy predicate condition then skip it
             if (LOG.isDebugEnabled()) {
@@ -757,7 +760,7 @@ public class OrcInputFormat  implements 
             currentOffset = stripe.getOffset();
             currentLength = stripe.getLength();
           } else {
-            currentLength += stripe.getLength();
+            currentLength = (stripe.getOffset() + stripe.getLength()) - 
currentOffset;
           }
           if (currentLength >= context.maxSize) {
             createSplit(currentOffset, currentLength, fileMetaInfo);


Reply via email to