This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 0e64090d81f [cherrypick](nereids)let DBA ignore some runtime filters 
#25933 (#26293)
0e64090d81f is described below

commit 0e64090d81f906ce7cb6aafdac182125953ec160
Author: minghong <engle...@gmail.com>
AuthorDate: Fri Nov 3 22:51:27 2023 +0800

    [cherrypick](nereids)let DBA ignore some runtime filters #25933 (#26293)
---
 .../glue/translator/RuntimeFilterTranslator.java   |  6 ++++++
 .../java/org/apache/doris/qe/SessionVariable.java  | 24 ++++++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/RuntimeFilterTranslator.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/RuntimeFilterTranslator.java
index 6980f05fa5d..35a75c28d92 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/RuntimeFilterTranslator.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/RuntimeFilterTranslator.java
@@ -36,6 +36,7 @@ import org.apache.doris.planner.HashJoinNode.DistributionMode;
 import org.apache.doris.planner.JoinNodeBase;
 import org.apache.doris.planner.RuntimeFilter.RuntimeFilterTarget;
 import org.apache.doris.planner.ScanNode;
+import org.apache.doris.qe.ConnectContext;
 import org.apache.doris.qe.SessionVariable;
 import org.apache.doris.thrift.TRuntimeFilterType;
 
@@ -108,6 +109,11 @@ public class RuntimeFilterTranslator {
      * @param ctx plan translator context
      */
     public void createLegacyRuntimeFilter(RuntimeFilter filter, JoinNodeBase 
node, PlanTranslatorContext ctx) {
+        if (ConnectContext.get() != null
+                && ConnectContext.get().getSessionVariable()
+                
.getIgnoredRuntimeFilterIds().contains(filter.getId().asInt())) {
+            return;
+        }
         Expr src = ExpressionTranslator.translate(filter.getSrcExpr(), ctx);
         List<Expr> targetExprList = new ArrayList<>();
         List<Map<TupleId, List<SlotId>>> targetTupleIdMapList = new 
ArrayList<>();
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
index c3e8c07b970..7425c97d7bb 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
@@ -1181,6 +1181,30 @@ public class SessionVariable implements Serializable, 
Writable {
             description = {"是否启用更快的浮点数转换算法,注意会影响输出格式", "Set true to enable 
faster float pointer number convert"})
     public boolean fasterFloatConvert = false;
 
+    @VariableMgr.VarAttr(name = IGNORE_RUNTIME_FILTER_IDS,
+            description = {"在IGNORE_RUNTIME_FILTER_IDS列表中的runtime 
filter将不会被生成",
+                    "the runtime filter id in IGNORE_RUNTIME_FILTER_IDS list 
will not be generated"})
+
+    public String ignoreRuntimeFilterIds = "";
+    public static final String IGNORE_RUNTIME_FILTER_IDS = 
"ignore_runtime_filter_ids";
+
+    public Set<Integer> getIgnoredRuntimeFilterIds() {
+        return Arrays.stream(ignoreRuntimeFilterIds.split(",[\\s]*"))
+                .map(v -> {
+                    int res = -1;
+                    try {
+                        res = Integer.valueOf(v);
+                    } catch (Exception e) {
+                        //ignore it
+                    }
+                    return res;
+                }).collect(ImmutableSet.toImmutableSet());
+    }
+
+    public void setIgnoreRuntimeFilterIds(String ignoreRuntimeFilterIds) {
+        this.ignoreRuntimeFilterIds = ignoreRuntimeFilterIds;
+    }
+
     public static final String IGNORE_SHAPE_NODE = "ignore_shape_nodes";
 
     public Set<String> getIgnoreShapePlanNodes() {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to