-
Notifications
You must be signed in to change notification settings - Fork 120
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
SNOW-1865926: Infer schema for StructType columns from nested Rows #2805
Merged
sfc-gh-jrose
merged 26 commits into
main
from
jrose_snow_1865926_create_dataframe_default_structured
Jan 7, 2025
Merged
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
d9bf2cb
SNOW-1829870: Allow structured types to be enabled by default
sfc-gh-jrose ec43e1a
type checking
sfc-gh-jrose 7f3a5fd
lint
sfc-gh-jrose 2e0dce9
Merge branch 'main' into jrose_snow_1829870_structured_by_default
sfc-gh-jrose ed232de
Move flag to context
sfc-gh-jrose 0dd7b91
typo
sfc-gh-jrose 13c1424
SNOW-1852779 Fix AST encoding for Column `in_`, `asc`, and `desc` (#2…
sfc-gh-vbudati a787e74
Merge branch 'main' into jrose_snow_1829870_structured_by_default
sfc-gh-jrose b32806f
merge main and fix test
sfc-gh-jrose c3db223
make feature flag thread safe
sfc-gh-jrose 1c262d7
typo
sfc-gh-jrose 869931f
Merge branch 'main' into jrose_snow_1829870_structured_by_default
sfc-gh-jrose 0caef58
Fix ast test
sfc-gh-jrose 2380040
move lock
sfc-gh-jrose 995e519
test coverage
sfc-gh-jrose 1b89027
remove context manager
sfc-gh-jrose 4fc61d4
Merge branch 'main' into jrose_snow_1829870_structured_by_default
sfc-gh-jrose 26fd29e
switch to using patch
sfc-gh-jrose 9295e11
move test to other module
sfc-gh-jrose fcd16d7
Merge branch 'main' into jrose_snow_1829870_structured_by_default
sfc-gh-jrose 77a57a6
fix broken import
sfc-gh-jrose 4769169
another broken import
sfc-gh-jrose af5af87
another test fix
sfc-gh-jrose dea741b
Merge branch 'main' into jrose_snow_1829870_structured_by_default
sfc-gh-jrose ee22980
SNOW-1865926: Infer schema for StructType columns from nested Rows
sfc-gh-jrose be73744
Merge branch 'main' into jrose_snow_1865926_create_dataframe_default_…
sfc-gh-jrose File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a chance that the given datatype is not StructType while users still input a Row as data? if so what would happen, do we error out?
or Row data always auto inferred as StructType?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what that scenario would look like. Can you give an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry I didn't make it clear, actually I had two questions:
when the infer schema logic would be triggered for
Row
values -- is it only when schema is not explicitly set?for my own learning purposes, will following Row input + MapType be a valid input?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently createDataFrame does not know how to handle casting Rows to Maps. You could get it to work by calling Row.as_dict if you wanted it to be a MapType.
After this change it's improved slightly:
Without this change the explicit schema still works.