Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Resolve default string producing expressions in analyzer #49607

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

stefankandic
Copy link
Contributor

@stefankandic stefankandic commented Jan 22, 2025

What changes were proposed in this pull request?

Changing DefaultStringProducingExpression expressions to return the proper default collation (of either the session or the object for DDL commands)

Why are the changes needed?

Previously, DefaultStringProducingExpression would always return the collation of the session, however for DDL commands they should return the collation of the object.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

New unit tests.

Was this patch authored or co-authored using generative AI tooling?

No.

@github-actions github-actions bot added the SQL label Jan 22, 2025
@stefankandic stefankandic force-pushed the resolveDefaultProducingStringFns branch from 150ae4a to ec0ad23 Compare January 23, 2025 15:14
}

private def needsCast(expression: Expression): Boolean = expression match {
case ex: DefaultStringProducingExpression => ex.getTagValue(CAST_ADDED_TAG).isEmpty
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cloud-fan Is there an easier way to do this that won't result in the infinite loop of always adding a cast on top of DefaultStringProducingExpression?

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.

1 participant