Github user parthchandra commented on a diff in the pull request:

    https://github.com/apache/drill/pull/162#discussion_r40274099
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/ParquetFixedWidthDictionaryReaders.java
 ---
    @@ -59,6 +63,50 @@ protected void readField(long recordsToReadInThisPass) {
         }
       }
     
    +  static class DictionaryFixedBinaryReader extends FixedByteAlignedReader {
    +
    +    VarBinaryVector castedVector;
    +
    +    DictionaryFixedBinaryReader(ParquetRecordReader parentReader, int 
allocateSize, ColumnDescriptor descriptor,
    +                        ColumnChunkMetaData columnChunkMetaData, boolean 
fixedLength, VarBinaryVector v,
    +                        SchemaElement schemaElement) throws 
ExecutionSetupException {
    +      super(parentReader, allocateSize, descriptor, columnChunkMetaData, 
fixedLength, v, schemaElement);
    +      castedVector = v;
    +    }
    +
    +    // this method is called by its superclass during a read loop
    +    @Override
    +    protected void readField(long recordsToReadInThisPass) {
    +
    +      recordsReadInThisIteration = Math.min(pageReader.currentPageCount
    +          - pageReader.valuesRead, recordsToReadInThisPass - 
valuesReadInCurrentPass);
    +
    +      if (usingDictionary) {
    +        VarBinaryVector.Mutator mutator =  castedVector.getMutator();
    +        Binary currDictValToWrite = null;
    +        for (int i = 0; i < recordsReadInThisIteration; i++){
    +          currDictValToWrite = 
pageReader.dictionaryValueReader.readBytes();
    +          mutator.setSafe(valuesReadInCurrentPass + i, 
currDictValToWrite.toByteBuffer(), 0,
    +              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 = castedVector.getBuffer().writerIndex();
    +        castedVector.getBuffer().setIndex(0, writerIndex + 
(int)readLength);
    --- End diff --
    
    It's set in the parent class NullableColumnReader::processPages()


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to