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-48288] Add source data type for connector cast expression #46596

Conversation

urosstan-db
Copy link
Contributor

@urosstan-db urosstan-db commented May 15, 2024

Currently,
V2ExpressionBuilder will build connector.Cast expression from catalyst.Cast expression.
Catalyst cast have expression data type, but connector cast does not have it.
Since some casts are not allowed on external engine, we need to know source and target data type, since we want finer granularity to block some unsupported casts.

What changes were proposed in this pull request?

Add source data type to connector Cast expression

Why are the changes needed?

We need finer granularity to allow implementors of SQLBuilder to disable some unsupported casts.

Does this PR introduce any user-facing change?

Yes, visitCast function is changed, and it needs to be overriden again.

How was this patch tested?

No tests made. Simple code change.

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

No

@github-actions github-actions bot added the SQL label May 15, 2024
@cloud-fan
Copy link
Contributor

the change LGTM. Please mention that users who override V2ExpressionSQLBuilder.visitCast should update their code, in Does this PR introduce any user-facing change? section.

@cloud-fan
Copy link
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in 4be0828 May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants