drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adeneche <...@git.apache.org>
Subject [GitHub] drill pull request: Drill 2908: Int96 support
Date Thu, 24 Sep 2015 04:02:12 GMT
Github user adeneche commented on a diff in the pull request:

    https://github.com/apache/drill/pull/162#discussion_r40283917
  
    --- 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 --
    
    `NullableColumnReader` is not one of the parent classes of `ParquetFixedWidthDictionaryReaders
`


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message