Skip to content

[CALCITE-7407] Illegal use of dynamic parameter with ||#4867

Open
macroguo-ghy wants to merge 2 commits into
apache:mainfrom
macroguo-ghy:calcite-7407
Open

[CALCITE-7407] Illegal use of dynamic parameter with ||#4867
macroguo-ghy wants to merge 2 commits into
apache:mainfrom
macroguo-ghy:calcite-7407

Conversation

@macroguo-ghy
Copy link
Copy Markdown
Contributor

Jira Link

CALCITE-7407

Changes Proposed

  • Change || to use InferTypes.RETURN_TYPE so dynamic parameters are typed from the string concatenation context instead of being rejected as illegal ANY operands.
  • Add validator regression coverage for concatenation with dynamic parameters, NULL, and CAST(NULL AS ANY).
  • Add a JDBC prepared statement regression covering ? || 'odore'.

Reproduction

select * from emp where ename = (? || 'KI')

Before this change, Calcite rejected the dynamic parameter in the concatenation expression with Illegal use of dynamic parameter.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 4, 2026

return type;
}),
null,
InferTypes.RETURN_TYPE,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens for ? || ?

@github-actions
Copy link
Copy Markdown

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@calcite.apache.org list. Thank you for your contributions.

@github-actions github-actions Bot added the stale label May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants