Github user jaltekruse commented on a diff in the pull request:
https://github.com/apache/drill/pull/81#discussion_r35810123
--- Diff:
exec/java-exec/src/main/codegen/templates/VariableLengthVectors.java ---
@@ -119,29 +117,22 @@ public int getVarByteLength(){
@Override
public SerializedField getMetadata() {
return getMetadataBuilder() //
+ .addChild(offsetVector.getMetadata())
.setValueCount(getAccessor().getValueCount()) //
- .setVarByteLength(getVarByteLength()) //
+// .setVarByteLength(getVarByteLength()) //
.setBufferLength(getBufferSize()) //
.build();
}
- public int load(int dataBytes, int valueCount, DrillBuf buf){
- if(valueCount == 0){
- allocateNew(0,0);
- return 0;
- }
- clear();
- int loaded = offsetVector.load(valueCount+1, buf);
- data = buf.slice(loaded, dataBytes - loaded);
- data.retain();
- return dataBytes;
- }
-
@Override
public void load(SerializedField metadata, DrillBuf buffer) {
- assert this.field.matches(metadata) : String.format("The field %s
doesn't match the provided metadata %s.", this.field, metadata);
- int loaded = load(metadata.getBufferLength(),
metadata.getValueCount(), buffer);
- assert metadata.getBufferLength() == loaded : String.format("Expected
to load %d bytes but actually loaded %d bytes", metadata.getBufferLength(),
loaded);
+ final SerializedField offsetField = metadata.getChild(0);
--- End diff --
Same as above in regards to these ordinals and their relationship to
getMetadataBuilder().
---
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.
---