SNOW-1876115: Allow column to cast to StructType.#2864
Merged
sfc-gh-yuwang merged 9 commits intomainfrom Jan 21, 2025
Merged
Conversation
sfc-gh-jrose
approved these changes
Jan 16, 2025
508e818 to
3267ed0
Compare
sfc-gh-aalam
approved these changes
Jan 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1876115
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
Allow column to cast to StructType. Edited generated SQL so that it can rename and add structtype.
We currently do not support RENAME FIELDS or ADD FIELDS in CAST statement and thats why example code in description fail. As I am trying this parameter, RENAME FIELDS only works for structured object and requires them to have the exact same number of fields.
in snowpark design, column is a isolated object that does not have the context of analyzer or the whole generated SQL, which means inside the column we can not know the datatype of it, let alone whether it have exact same number of fields as the datatype it is casting to.
To workaround this, I’ll add parameters in .cast().
please to refer to jira tickets for more detail