diff --git a/presto-main/src/main/java/io/prestosql/operator/PartitionedOutputOperator.java b/presto-main/src/main/java/io/prestosql/operator/PartitionedOutputOperator.java index bc45cfdb1..4c7fe5df7 100644 --- a/presto-main/src/main/java/io/prestosql/operator/PartitionedOutputOperator.java +++ b/presto-main/src/main/java/io/prestosql/operator/PartitionedOutputOperator.java @@ -524,8 +524,8 @@ public Object capture(BlockEncodingSerdeProvider serdeProvider) { PagePartitionerState myState = new PagePartitionerState(); // This was just flushed, so page builders must be empty - for (int i = 0; i < pageBuilders.length; i++) { - checkState(pageBuilders[i].isEmpty()); + for (PageBuilder pageBuilder : pageBuilders) { + checkState(pageBuilder.isEmpty()); } myState.rowsAdded = rowsAdded.get(); myState.pagesAdded = pagesAdded.get(); diff --git a/presto-main/src/main/java/io/prestosql/sql/planner/LocalExecutionPlanner.java b/presto-main/src/main/java/io/prestosql/sql/planner/LocalExecutionPlanner.java index 2fae9cdfc..8d25c7e2a 100644 --- a/presto-main/src/main/java/io/prestosql/sql/planner/LocalExecutionPlanner.java +++ b/presto-main/src/main/java/io/prestosql/sql/planner/LocalExecutionPlanner.java @@ -3134,9 +3134,7 @@ else if (context.getDriverInstanceCount().isPresent()) { PipelineExecutionStrategy exchangeSourcePipelineExecutionStrategy = GROUPED_EXECUTION; List driverFactoryParametersList = new ArrayList<>(); - for (int i = 0; i < node.getSources().size(); i++) { - PlanNode sourceNode = node.getSources().get(i); - + for (PlanNode sourceNode : node.getSources()) { LocalExecutionPlanContext subContext = context.createSubContext(); PhysicalOperation source = sourceNode.accept(this, subContext); driverFactoryParametersList.add(new DriverFactoryParameters(subContext, source));