Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.apache.arrow.vector.types.pojo.Field;
import org.apache.arrow.vector.types.pojo.Schema;
import org.apache.arrow.vector.util.DictionaryUtility;
import org.apache.arrow.vector.util.VectorBatchAppender;
import org.apache.arrow.vector.validate.MetadataV4UnionChecker;

/** An adaptor between protobuf streams and flight data streams. */
Expand Down Expand Up @@ -291,13 +292,21 @@ public boolean next() {
}

final FieldVector vector = dictionary.getVector();
final VectorSchemaRoot dictionaryRoot =
new VectorSchemaRoot(
Collections.singletonList(vector.getField()),
Collections.singletonList(vector),
0);
final VectorLoader dictionaryLoader = new VectorLoader(dictionaryRoot);
dictionaryLoader.load(arb.getDictionary());
if (arb.isDelta()) {
try (FieldVector deltaVector = vector.getField().createVector(allocator)) {
final VectorSchemaRoot deltaRoot = VectorSchemaRoot.of(deltaVector);
new VectorLoader(deltaRoot).load(arb.getDictionary());
VectorBatchAppender.batchAppend(vector, deltaVector);
}
} else {
final VectorSchemaRoot dictionaryRoot =
new VectorSchemaRoot(
Collections.singletonList(vector.getField()),
Collections.singletonList(vector),
0);
final VectorLoader dictionaryLoader = new VectorLoader(dictionaryRoot);
dictionaryLoader.load(arb.getDictionary());
}
}
return next();
} else {
Expand Down
Loading
Loading