diff --git a/fe/fe-core/src/main/java/com/starrocks/planner/MultiCastPlanFragment.java b/fe/fe-core/src/main/java/com/starrocks/planner/MultiCastPlanFragment.java index 55189962e62a0..69b7a30e01537 100644 --- a/fe/fe-core/src/main/java/com/starrocks/planner/MultiCastPlanFragment.java +++ b/fe/fe-core/src/main/java/com/starrocks/planner/MultiCastPlanFragment.java @@ -45,6 +45,7 @@ public MultiCastPlanFragment(PlanFragment planFragment) { this.children.addAll(planFragment.getChildren()); this.setLoadGlobalDicts(planFragment.loadGlobalDicts); this.setQueryGlobalDicts(planFragment.queryGlobalDicts); + this.setQueryGlobalDictExprs(planFragment.queryGlobalDictExprs); } public List getDestFragmentList() { diff --git a/fe/fe-core/src/test/java/com/starrocks/sql/plan/LowCardinalityArrayTest.java b/fe/fe-core/src/test/java/com/starrocks/sql/plan/LowCardinalityArrayTest.java index 8d09b99d5895d..a81aa770eaa7e 100644 --- a/fe/fe-core/src/test/java/com/starrocks/sql/plan/LowCardinalityArrayTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/sql/plan/LowCardinalityArrayTest.java @@ -174,6 +174,17 @@ public void testArrayPredicate2() throws Exception { " | 10 <-> [10: S_ADDRESS, ARRAY, true]")); } + @Test + public void testWithCTE() throws Exception { + connectContext.getSessionVariable().setCboCteReuse(true); + connectContext.getSessionVariable().setCboCTERuseRatio(0); + String sql = "with cte as (select * from supplier_nullable, unnest(S_ADDRESS)) " + + "select * from cte union all select * from cte"; + String plan = getVerboseExplain(sql); + assertContains(plan, "41: DictDefine(39: S_ADDRESS, [])"); + connectContext.getSessionVariable().setCboCteReuse(false); + } + @Test public void testArrayPredicate3() throws Exception { String sql = "select S_ADDRESS from supplier_nullable where S_ADDRESS = ['a', 'b']";