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

[SPARK-50692] Add RPAD pushdown support #49325

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrej-db
Copy link
Contributor

What changes were proposed in this pull request?

This PR makes RPAD function translatable across connectors. Individual connectors can now support this via their dialects.

Why are the changes needed?

When trying to compare CHAR(...) and a literal, Spark injects a RPAD function to make the CHAR parameter the same length. This behaviour is per ANSI standard.

The problem is that RPAD is not only an unsupported, but an untranslatable function. This prevents CHAR + literal comparison pushdown.

Solution is to support RPAD pushdowns and implement it when needed

Does this PR introduce any user-facing change?

No.

How was this patch tested?

This PR only introduces the ability to support the RPAD pushdown. Individual connectors will have their own tests.

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

No

V2ExpressionSQLBuilder: register RPAD as a visitSqlFunction
@github-actions github-actions bot added the SQL label Dec 27, 2024
@HyukjinKwon
Copy link
Member

cc @beliefer

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.

3 participants