From 18639b94438f87a1da4a8a36256a2a672e4cc8b4 Mon Sep 17 00:00:00 2001 From: Saurabh Dubey Date: Fri, 3 Nov 2023 12:54:42 +0530 Subject: [PATCH] Early release AcquireReleaseColumnsSegmentOperator during explain plan (#11945) Co-authored-by: Saurabh Dubey --- .../src/main/java/org/apache/pinot/core/common/Operator.java | 4 ++++ .../core/operator/AcquireReleaseColumnsSegmentOperator.java | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/pinot-core/src/main/java/org/apache/pinot/core/common/Operator.java b/pinot-core/src/main/java/org/apache/pinot/core/common/Operator.java index b6abbcb266ea..760074538b4e 100644 --- a/pinot-core/src/main/java/org/apache/pinot/core/common/Operator.java +++ b/pinot-core/src/main/java/org/apache/pinot/core/common/Operator.java @@ -51,6 +51,9 @@ public interface Operator { default void prepareForExplainPlan(ExplainPlanRows explainPlanRows) { } + default void postExplainPlan(ExplainPlanRows explainPlanRows) { + } + default void explainPlan(ExplainPlanRows explainPlanRows, int[] globalId, int parentId) { prepareForExplainPlan(explainPlanRows); String explainPlanString = toExplainString(); @@ -66,6 +69,7 @@ default void explainPlan(ExplainPlanRows explainPlanRows, int[] globalId, int pa child.explainPlan(explainPlanRows, globalId, parentId); } } + postExplainPlan(explainPlanRows); } /** diff --git a/pinot-core/src/main/java/org/apache/pinot/core/operator/AcquireReleaseColumnsSegmentOperator.java b/pinot-core/src/main/java/org/apache/pinot/core/operator/AcquireReleaseColumnsSegmentOperator.java index 2b7229243146..0f535b780638 100644 --- a/pinot-core/src/main/java/org/apache/pinot/core/operator/AcquireReleaseColumnsSegmentOperator.java +++ b/pinot-core/src/main/java/org/apache/pinot/core/operator/AcquireReleaseColumnsSegmentOperator.java @@ -92,6 +92,11 @@ public void prepareForExplainPlan(ExplainPlanRows explainPlanRows) { materializeChildOperator(); } + @Override + public void postExplainPlan(ExplainPlanRows explainPlanRows) { + release(); + } + @Override public String toExplainString() { return EXPLAIN_NAME;