Ben-Zvi commented on a change in pull request #1362: DRILL-6576: Unnest reports
incoming record counts incorrectly
URL: https://github.com/apache/drill/pull/1362#discussion_r199908575
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/unnest/UnnestRecordBatch.java
##########
@@ -207,32 +208,30 @@ public IterOutcome innerNext() {
} finally {
stats.stopSetup();
}
- // since we never called next on an upstream operator, incoming stats are
- // not updated. update input stats explicitly.
- stats.batchReceived(0, incoming.getRecordCount(), true);
return IterOutcome.OK_NEW_SCHEMA;
} else {
assert state != BatchState.FIRST : "First batch should be OK_NEW_SCHEMA";
container.zeroVectors();
-
// Check if schema has changed
- if (lateral.getRecordIndex() == 0 && schemaChanged()) {
- hasRemainder = true; // next call to next will handle the actual
data.
- try {
- setupNewSchema();
- } catch (SchemaChangeException ex) {
- kill(false);
- logger.error("Failure during query", ex);
- context.getExecutorState().fail(ex);
- return IterOutcome.STOP;
- }
- stats.batchReceived(0, incoming.getRecordCount(), true);
- return OK_NEW_SCHEMA;
- }
if (lateral.getRecordIndex() == 0) {
- unnest.resetGroupIndex();
+ boolean isNewSchema = schemaChanged();
+ if (isNewSchema) {
+ hasRemainder = true; // next call to next will handle the actual
data.
+ stats.batchReceived(0, incoming.getRecordCount(), isNewSchema);
Review comment:
(Very minor) The same stats call is in both sides of the if(); can be called
once before the if(). Also can erase the "else" as the first part of the if()
returns.
----------------------------------------------------------------
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