Skip to content

Commit

Permalink
[BugFix] Fix CTE lowcardinality array couldn't found DictExpr (StarRo…
Browse files Browse the repository at this point in the history
…cks#51148)

Signed-off-by: stdpain <drfeng08@gmail.com>
Signed-off-by: zhiminr.ren <1240388654@qq.com>
  • Loading branch information
stdpain authored and renzhimin7 committed Nov 7, 2024
1 parent 49c0431 commit 2159ad4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<PlanFragment> getDestFragmentList() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,17 @@ public void testArrayPredicate2() throws Exception {
" | 10 <-> [10: S_ADDRESS, ARRAY<INT>, 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, [<place-holder>])");
connectContext.getSessionVariable().setCboCteReuse(false);
}

@Test
public void testArrayPredicate3() throws Exception {
String sql = "select S_ADDRESS from supplier_nullable where S_ADDRESS = ['a', 'b']";
Expand Down

0 comments on commit 2159ad4

Please sign in to comment.