Skip to content

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

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

[CALCITE-7407] Illegal use of dynamic parameter with ||#4867
macroguo-ghy wants to merge 2 commits intoapache: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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant