forked from prestodb/presto
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Implemented parametric VARCHAR #88
Closed
Closed
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
Currently it is hard to calculate length of return type properly for vararg functions.
This patch changes the way optimization for not inserting cast calls for type-type only coercions work. Original code caused errors during bytecode preparation for plan execution. Problematic case: ARRAY('dog', 'kitten'). During semantic analysis this was treated as: ARRAY((CAST 'dog' as VARCHAR(6)), 'kitten') and therefore implementation of ArrayConstructor for parameter type VARCHAR(6) was generated. But cast expression was not added to result query expression, as case VARCHAR(3) -> VARCHAR(6) is type-only cast. Then byte generating code was failing as it was looking for instantiation of ARRAY_CONSTRUCTOR(VARCHAR(3), VARCHAR(6)) despite the fact only ARRAY_CONSTRUCTOR(VARCHAR(6), VARCHAR(6)) was generated. Now we add Cast operator to AST. But it has typeOnly marker set to true. And then when execution plan is generated no cast operation call is generated.
1. relax limitation that when INSERT INTO statement is called values/query types must exactly match table column types. Now we allow values/query types to be type-only coercible to table column types. 2. allow difference between inserted values and table column types if they are type-coercable for structural types.
This pull request follows prestodb#4005 |
Superseded by prestodb#4303 |
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.
No description provided.