[SPARK-48288] Add source data type for connector cast expression #46596
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
expressionWhy 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