Skip to content

Analyse analytic and conversion functions with complete window traversal - #2579

Merged
manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:fix/function-feature-analysis
Sep 11, 2026
Merged

Analyse analytic and conversion functions with complete window traversal#2579
manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:fix/function-feature-analysis

Conversation

@minleejae

Copy link
Copy Markdown
Contributor

getFeatures(pureFunctions) misses the function name in an analytic call or CONVERT/TRY_CONVERT expression, so unproven calls can be classified as unable to modify data. Window PARTITION BY, ORDER BY and FILTER expressions are also skipped, and an aggregate's internal ORDER BY can trigger a null-list exception.

Share function-name normalization and purity checks across the three expression forms. Use the conversion keyword as the function name, and preserve qualified analytic names through the existing Function name renderer. Unproven effects remain possible rather than certain.

WindowDefinition now supplies its partition, ordering and frame expressions to both inline and named-window traversal. ExpressionVisitorAdapter visits both ordering lists, filters and function modifiers through its existing child-visitor hook. Ordinary and analytic functions share modifier collection, preserving HAVING, keyword arguments and LIMIT expressions when a Function becomes an AnalyticExpression.

Validation: full Gradle check and Maven verify; pure/unproven function controls, qualified names, nested calls, inline/named windows, both ordering lists, FILTER, frame bounds, offsets/defaults, modifier conversion, callback order/context and existing feature/visitor regression tests.

Fixes #2575.

@manticore-projects
manticore-projects merged commit 01d7c3e into JSQLParser:master Sep 11, 2026
9 checks passed
@manticore-projects

Copy link
Copy Markdown
Contributor

Thank you very much for fixing this so fast!

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.

StatementFeatureVisitor purity check misses AnalyticExpression (f(x) OVER ..) and TranscodingFunction (CONVERT .. USING)

2 participants