Skip to content

Commit

Permalink
[BugFix] skip apply dict optimize to callOperator without function si…
Browse files Browse the repository at this point in the history
…gnature (#35053)

Signed-off-by: packy92 <wangchao@starrocks.com>
  • Loading branch information
packy92 authored Nov 16, 2023
1 parent 4a990fd commit e02a630
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public ScalarOperator visit(ScalarOperator scalarOperator, RewriterContext conte

@Override
public ScalarOperator visitCall(CallOperator call, RewriterContext context) {
if (!call.getFunction().isCouldApplyDictOptimize()) {
if (call.getFunction() == null || !call.getFunction().isCouldApplyDictOptimize()) {
context.hasAppliedOperator = false;
context.hasUnsupportedOperator = true;
return visit(call, context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1892,4 +1892,16 @@ public void testProjectionRewrite() throws Exception {
" | output: sum(24: fee_zb)\n" +
" | group by: 55: c_mr");
}

@Test
public void testInformationFunc() throws Exception {
String sql = "select if(current_role = 'root', concat(S_ADDRESS, 'ccc'), '***') from supplier order by 1";
String plan = getFragmentPlan(sql);
assertContains(plan, "2:SORT\n" +
" | order by: <slot 9> 9: if ASC\n" +
" | offset: 0\n" +
" | \n" +
" 1:Project\n" +
" | <slot 9> : if(CURRENT_ROLE() = 'root', DictExpr(10: S_ADDRESS,[concat(<place-holder>, 'ccc')]), '***')");
}
}

0 comments on commit e02a630

Please sign in to comment.