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 @@ -1037,7 +1037,7 @@ private static boolean isScheduled(Optional<StageInfo> rootStage)
}
return getAllStages(rootStage).stream()
.map(StageInfo::getState)
.allMatch(state -> state == StageState.RUNNING || state == StageState.FLUSHING || state.isDone());
.allMatch(state -> state == StageState.RUNNING || state == StageState.PENDING || state.isDone());
}

public Optional<ExecutionFailureInfo> getFailureInfo()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import io.trino.cost.StatsCalculator;
import io.trino.execution.QueryPreparer.PreparedQuery;
import io.trino.execution.StateMachine.StateChangeListener;
import io.trino.execution.buffer.OutputBuffers;
import io.trino.execution.buffer.OutputBuffers.OutputBufferId;
import io.trino.execution.scheduler.ExecutionPolicy;
import io.trino.execution.scheduler.NodeScheduler;
import io.trino.execution.scheduler.SplitSchedulerStats;
Expand Down Expand Up @@ -55,7 +53,6 @@
import io.trino.sql.planner.InputExtractor;
import io.trino.sql.planner.LogicalPlanner;
import io.trino.sql.planner.NodePartitioningManager;
import io.trino.sql.planner.PartitioningHandle;
import io.trino.sql.planner.Plan;
import io.trino.sql.planner.PlanFragmenter;
import io.trino.sql.planner.PlanNodeIdAllocator;
Expand Down Expand Up @@ -89,8 +86,6 @@
import static io.trino.SystemSessionProperties.isEnableDynamicFiltering;
import static io.trino.execution.QueryState.FAILED;
import static io.trino.execution.QueryState.PLANNING;
import static io.trino.execution.buffer.OutputBuffers.BROADCAST_PARTITION_ID;
import static io.trino.execution.buffer.OutputBuffers.createInitialEmptyOutputBuffers;
import static io.trino.execution.scheduler.SqlQueryScheduler.createSqlQueryScheduler;
import static io.trino.server.DynamicFilterService.DynamicFiltersStats;
import static io.trino.spi.StandardErrorCode.NOT_SUPPORTED;
Expand All @@ -105,8 +100,6 @@ public class SqlQueryExecution
{
private static final Logger log = Logger.get(SqlQueryExecution.class);

private static final OutputBufferId OUTPUT_BUFFER_ID = new OutputBufferId(0);

private final QueryStateMachine stateMachine;
private final Slug slug;
private final Metadata metadata;
Expand Down Expand Up @@ -522,25 +515,18 @@ private void planDistribution(PlanRoot plan)
// record output field
stateMachine.setColumns(outputStageExecutionPlan.getFieldNames(), outputStageExecutionPlan.getFragment().getTypes());

PartitioningHandle partitioningHandle = plan.getRoot().getFragment().getPartitioningScheme().getPartitioning().getHandle();
OutputBuffers rootOutputBuffers = createInitialEmptyOutputBuffers(partitioningHandle)
.withBuffer(OUTPUT_BUFFER_ID, BROADCAST_PARTITION_ID)
.withNoMoreBufferIds();

// build the stage execution objects (this doesn't schedule execution)
SqlQueryScheduler scheduler = createSqlQueryScheduler(
stateMachine,
outputStageExecutionPlan,
nodePartitioningManager,
nodeScheduler,
remoteTaskFactory,
stateMachine.getSession(),
plan.isSummarizeTaskInfos(),
scheduleSplitBatchSize,
queryExecutor,
schedulerExecutor,
failureDetector,
rootOutputBuffers,
nodeTaskMap,
executionPolicy,
schedulerStats,
Expand Down
Loading