ilooner commented on a change in pull request #1344: DRILL-6461: Added basic
data correctness tests for hash agg, and improved operator unit testing
framework.
URL: https://github.com/apache/drill/pull/1344#discussion_r211038182
##########
File path:
exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/MockRecordBatch.java
##########
@@ -158,19 +210,34 @@ public IterOutcome next() {
container.clear();
container = new VectorContainer(allocator, inputSchema);
}
- container.transferIn(input);
- container.setRecordCount(recordCount);
-
- // Transfer the sv2 as well
- final SelectionVector2 inputSv2 =
- (allTestContainersSv2 != null && allTestContainersSv2.size() > 0)
- ? allTestContainersSv2.get(currentContainerIndex) : null;
- if (inputSv2 != null) {
- sv2.allocateNewSafe(inputSv2.getCount());
- for (int i=0; i<inputSv2.getCount(); ++i) {
- sv2.setIndex(i, inputSv2.getIndex(i));
- }
- sv2.setRecordCount(inputSv2.getCount());
+
+ switch (rowSet.indirectionType()) {
+ case NONE:
+ case TWO_BYTE:
+ container.transferIn(input);
+ container.setRecordCount(recordCount);
+ final SelectionVector2 inputSv2 = ((RowSet.SingleRowSet)
rowSet).getSv2();
+
+ if (sv2 != null) {
+ // Operators like PartitionLimitRecordBatch assume that new values
for an Sv2 are transferred in.
Review comment:
done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services