[ https://issues.apache.org/jira/browse/DRILL-3313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14646741#comment-14646741
]
ASF GitHub Bot commented on DRILL-3313:
---------------------------------------
Github user jaltekruse commented on a diff in the pull request:
https://github.com/apache/drill/pull/81#discussion_r35810016
--- Diff: exec/java-exec/src/main/codegen/templates/NullableValueVectors.java ---
@@ -239,37 +183,30 @@ public void allocateNew(int valueCount) {
accessor.reset();
}
- /**
- * {@inheritDoc}
- */
+ @Override
public void zeroVector() {
- this.values.zeroVector();
- this.bits.zeroVector();
+ bits.zeroVector();
+ values.zeroVector();
}
+ </#if>
- @Override
- public int load(int valueCount, DrillBuf buf){
- clear();
- int loaded = bits.load(valueCount, buf);
-
- // remove bits part of buffer.
- buf = buf.slice(loaded, buf.capacity() - loaded);
- loaded += values.load(valueCount, buf);
- return loaded;
- }
@Override
public void load(SerializedField metadata, DrillBuf buffer) {
- assert this.field.matches(metadata);
- int loaded = load(metadata.getValueCount(), buffer);
- assert metadata.getBufferLength() == loaded;
- }
+ clear();
+ final SerializedField bitsField = metadata.getChild(0);
--- End diff --
I understand previously we weren't storing any metadata for the bit vector, but I think
this addition could be a little clearer by at least commenting that these indexes are based
on the order of the calls in getMetadataBuilder(). It would probably be worth it to add a
comment up on the method itself that these additions are order sensitive.
> Eliminate redundant #load methods and unit-test loading & exporting of vectors
> ------------------------------------------------------------------------------
>
> Key: DRILL-3313
> URL: https://issues.apache.org/jira/browse/DRILL-3313
> Project: Apache Drill
> Issue Type: Sub-task
> Components: Execution - Data Types
> Affects Versions: 1.0.0
> Reporter: Hanifi Gunes
> Assignee: Jason Altekruse
> Fix For: 1.2.0
>
>
> Vectors have multiple #load methods that are used to populate data from raw buffers.
It is relatively tough to reason, maintain and unit-test loading and exporting of data since
there is many redundant code around load methods. This issue proposes to have single #load
method conforming to VV#load(def, buffer) signature eliminating all other #load overrides.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
|