Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/729#discussion_r100676876
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/StreamingAggBatch.java
---
@@ -82,11 +82,18 @@
private boolean specialBatchSent = false;
private static final int SPECIAL_BATCH_COUNT = 1;
- public StreamingAggBatch(StreamingAggregate popConfig, RecordBatch
incoming, FragmentContext context) throws OutOfMemoryException {
+ public StreamingAggBatch(StreamingAggregate popConfig, RecordBatch
incoming, FragmentContext context)
+ throws OutOfMemoryException {
super(popConfig, context);
this.incoming = incoming;
}
+ public StreamingAggBatch(StreamingAggregate popConfig, RecordBatch
incoming, FragmentContext context,
+ final boolean buildSchema) throws
OutOfMemoryException {
--- End diff --
Javadoc or plain comments are wonderful things. Perhaps we can use one here
to explain the purpose of this constructor.
A Record Batch, in Drill, is really an operator that happens (bizarrely) to
also hold onto a record batch. As an operator, the streaming agg must build its
schema from the incoming. Like all operators, it does so on the first batch and
(perhaps) on each schema change event.
Given that, why do we need a flag to tell this operator to build its
schema? Are we trying to use the operator for something for which it was not
intended?
---
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.
---