Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] Fix CTE lowcardinality array couldn't found DictExpr #51148

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading