Github user daveoshinsky commented on a diff in the pull request:
https://github.com/apache/drill/pull/372#discussion_r55417098
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/NullableVarLengthValuesColumn.java
---
@@ -69,11 +73,16 @@ protected boolean readAndStoreValueSizeInformation()
throws IOException {
if ( currDefLevel == -1 ) {
currDefLevel = pageReader.definitionLevels.readInteger();
}
- if ( columnDescriptor.getMaxDefinitionLevel() > currDefLevel) {
+
+ if (columnDescriptor.getMaxDefinitionLevel() > currDefLevel) {
nullsRead++;
- // set length of zero, each index in the vector defaults to null so
no need to set the nullability
- variableWidthVector.getMutator().setValueLengthSafe(
- valuesReadInCurrentPass + pageReader.valuesReadyToRead, 0);
+ // set length of zero, each index in the vector defaults to null so
no
+ // need to set the nullability
+ if (variableWidthVector == null) {
--- End diff --
Regarding the two variables variableWidthVector and fixedWidthVector that I
added, here is my reasoning. Either variableWidthVector is set if we have a
VariableWidthVector, or fixedWidthVector is set if we have a FixedWidthVector
(i.e., decimal). Hence, variableWidthVector is non-null if and only if we are
to invoke the pre-existing logic, that assumed a variable width vector. When
variableWidthVector is null (fixedWidthVector is non-null, but not currently
used), we invoke the new logic to save the length information in
decimalLengths. If this is no good, please tell me why, and suggest an
alternative.
---
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.
---