-
Notifications
You must be signed in to change notification settings - Fork 94
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
Implement Implicit Casting of Nested Types and Type Combination with MaxLogicalType #3234
Merged
Conversation
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
reconfigure fix tests new maxlogicaltype fixes rdf comparison fix fix tests remove added empty lines add implicit casting between nested types fix rename tryCombineVarListTypes to tryCombineListTypes disallow union casting Run clang-format remove test logs Run clang-format remove test logs
andyfengHKU
requested changes
Apr 9, 2024
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.
Overall LGTM but I need to take another look
Merged
…into type-combination
…into type-combination
andyfengHKU
approved these changes
Apr 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Nested Implicit Casting Rules:
If the source type and destination type have different LogicalTypeIDs, no implicit cast is possible
If both types are Lists, an implicit cast is possible if their children have an implicit cast from src to dest. Arrays follow the same rule, but an additional check is made to make sure the arrays are of the same length
If both types are Structs, check if the field names match and then check if the matching children have an implicit cast from src to dest.
If both types are Maps, check that the key and value types have implicit casts from src to dest
Union casting seems to be completely unsupported right now, so no implicit casting is allowed.
Update: ARRAY -> LIST implicit casting has been implemented. It goes just the way you would expect it to go.
Max Logical Type Combination Rules:
Case 1:
If at least one type is nonnested,
internalTypeOrder
, as defined intypes.cpp
Case 2:
If both types are nested, the rules are identical to implicit casting rules, but instead of checking "if the src children can implicit cast to the dst children", we check "if the src children can combine with the dst children".