Skip to content

Commit

Permalink
DRILL-7018: Fixed Parquet buffer overflow when reading timestamp column
Browse files Browse the repository at this point in the history
close #1630
  • Loading branch information
sachouche authored and Aman Sinha committed Feb 1, 2019
1 parent 9c82e06 commit b1594cb
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -111,6 +111,9 @@ static class NullableFixedBinaryAsTimeStampReader extends NullableFixedByteAlign
NullableFixedBinaryAsTimeStampReader(ParquetRecordReader parentReader, ColumnDescriptor descriptor,
ColumnChunkMetaData columnChunkMetaData, boolean fixedLength, NullableTimeStampVector v, SchemaElement schemaElement) throws ExecutionSetupException {
super(parentReader, descriptor, columnChunkMetaData, fixedLength, v, schemaElement);

// The width of each element of the TimeStampVector is 8 bytes (64 bits) instead of 12 bytes.
dataTypeLengthInBits = NullableTimeStampHolder.WIDTH * 8;
}

@Override
Expand All @@ -127,8 +130,6 @@ protected void readField(long recordsToReadInThisPass) {
valueVec.getMutator().setSafe(valuesReadInCurrentPass + i, getDateTimeValueFromBinary(binaryTimeStampValue, true));
}
}
// The width of each element of the TimeStampVector is 8 bytes (64 bits) instead of 12 bytes.
dataTypeLengthInBits = NullableTimeStampHolder.WIDTH * 8;
}
}

Expand Down

0 comments on commit b1594cb

Please sign in to comment.