You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by ar...@apache.org on 2018/07/13 17:40:49 UTC

[drill] branch master updated: DRILL-5495: convert_from function on top of int96 data results in ArrayIndexOutOfBoundsException

This is an automated email from the ASF dual-hosted git repository.

arina pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/drill.git


The following commit(s) were added to refs/heads/master by this push:
     new feb99ac  DRILL-5495: convert_from function on top of int96 data results in ArrayIndexOutOfBoundsException
feb99ac is described below

commit feb99ac1a73522ce9f5dd5e3b001a89722130dbc
Author: Vitalii Diravka <vi...@gmail.com>
AuthorDate: Fri Jul 13 17:29:59 2018 +0300

    DRILL-5495: convert_from function on top of int96 data results in ArrayIndexOutOfBoundsException
---
 .../parquet/columnreaders/NullableFixedByteAlignedReaders.java     | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/NullableFixedByteAlignedReaders.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/NullableFixedByteAlignedReaders.java
index 6a09bd6..89aa808 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/NullableFixedByteAlignedReaders.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/NullableFixedByteAlignedReaders.java
@@ -81,17 +81,16 @@ public class NullableFixedByteAlignedReaders {
       if (usingDictionary) {
         NullableVarBinaryVector.Mutator mutator =  valueVec.getMutator();
         Binary currDictValToWrite;
-        for (int i = 0; i < recordsReadInThisIteration; i++){
+        for (int i = 0; i < recordsToReadInThisPass; i++) {
           currDictValToWrite = pageReader.dictionaryValueReader.readBytes();
           ByteBuffer buf = currDictValToWrite.toByteBuffer();
-          mutator.setSafe(valuesReadInCurrentPass + i, buf, buf.position(),
-              currDictValToWrite.length());
+          mutator.setSafe(valuesReadInCurrentPass + i, buf, buf.position(), currDictValToWrite.length());
         }
         // Set the write Index. The next page that gets read might be a page that does not use dictionary encoding
         // and we will go into the else condition below. The readField method of the parent class requires the
         // writer index to be set correctly.
         int writerIndex = castedBaseVector.getBuffer().writerIndex();
-        castedBaseVector.getBuffer().setIndex(0, writerIndex + (int)readLength);
+        castedBaseVector.getBuffer().setIndex(0, writerIndex + (int) readLength);
       } else {
         super.readField(recordsToReadInThisPass);
         // TODO - replace this with fixed binary type in drill