Skip to content

IGNITE-29033 SQL Calcite: Support UDF and UDTF Overloading - #13544

Open
tkalkirill wants to merge 2 commits into
masterfrom
ignite-29033
Open

IGNITE-29033 SQL Calcite: Support UDF and UDTF Overloading#13544
tkalkirill wants to merge 2 commits into
masterfrom
ignite-29033

Conversation

@tkalkirill

Copy link
Copy Markdown
Contributor


assertEquals(2, schema.getFunctions("OVERLOADED").size());
assertEquals(2, schema.getFunctions("OVERLOADED_TABLE").size());
assertEquals(1, schema.getFunctions("SQL_EQUIVALENT").size());

@zstan zstan Sep 3, 2026

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.

I wonder - why ? Behavior is different from java - is it ok ? It can confuse and brings, as minimal, unexpected behavior ? If it calcite related design - plz show me the related links ? And as minimal - i expect it need to be documented somehow ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This behavior intentionally differs from Java because overload resolution uses SQL types. Both int and Integer correspond to SQL INTEGER, so Calcite cannot reliably distinguish these overloads and their resolution would depend on registration order.
Therefore, overloads must have different SQL parameter types or parameter order. I’ve also documented this behavior in QuerySqlFunction and QuerySqlTableFunction.

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.

2 participants