Skip to content

Commit

Permalink
make AcquireReleaseColumnsSegmentOperator work for V2 (#14649)
Browse files Browse the repository at this point in the history
  • Loading branch information
klsince authored Dec 13, 2024
1 parent 90b437f commit 607bed2
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ public AcquireReleaseColumnsSegmentOperator(PlanNode planNode, IndexSegment inde
}

public void materializeChildOperator() {
_childOperator = (Operator<BaseResultsBlock>) _planNode.run();
// V2 query engine can call getNextBlock() methods repetitively to stream result blocks between query stages, but
// the query plan should be created just once, so cache the child operator. And no need to synchronize here as the
// operator object is used by a single thread.
if (_childOperator == null) {
_childOperator = (Operator<BaseResultsBlock>) _planNode.run();
}
}

/**
Expand Down Expand Up @@ -102,6 +107,7 @@ public void postExplainPlan(ExplainPlanRows explainPlanRows) {
public ExplainInfo getExplainInfo() {
acquire();
try {
materializeChildOperator();
return super.getExplainInfo();
} finally {
release();
Expand Down

0 comments on commit 607bed2

Please sign in to comment.