Handle CAST in canonicalized LambdaDefinitionExpression#14912
Merged
rongrong merged 1 commit intoprestodb:masterfrom Jul 29, 2020
Merged
Handle CAST in canonicalized LambdaDefinitionExpression#14912rongrong merged 1 commit intoprestodb:masterfrom
rongrong merged 1 commit intoprestodb:masterfrom
Conversation
Include CallExpression return type in canonicalized LambdaDefinitionExpression so CAST with same input type would not be mistakenly canonicalized.
kaikalur
approved these changes
Jul 28, 2020
| public String visitCall(CallExpression call, Void context) | ||
| { | ||
| return format("%s.%s(%s)", call.getFunctionHandle().getFunctionNamespace(), call.getDisplayName(), String.join(", ", call.getArguments().stream().map(e -> e.accept(this, null)).collect(Collectors.toList()))); | ||
| return format("%s.%s(%s):%s", call.getFunctionHandle().getFunctionNamespace(), call.getDisplayName(), String.join(", ", call.getArguments().stream().map(e -> e.accept(this, null)).collect(Collectors.toList())), call.getType()); |
Contributor
There was a problem hiding this comment.
Probably better to do it only for CAST so we don't accidentally cause other issues?
Contributor
Author
There was a problem hiding this comment.
For all other functions, return type should be the same if name and input type is the same. So this is just adding a little overhead. However, in any case that return type is different, it would be wrong to canonicalize them. So I think it's safe to keep it for all functions. Also not all cast functions are just called "cast". We don't really have an error prone way to identify all cast functions...
Contributor
There was a problem hiding this comment.
probably good to have one parameter per line now? 😄
highker
approved these changes
Jul 29, 2020
wenleix
approved these changes
Jul 29, 2020
| public String visitCall(CallExpression call, Void context) | ||
| { | ||
| return format("%s.%s(%s)", call.getFunctionHandle().getFunctionNamespace(), call.getDisplayName(), String.join(", ", call.getArguments().stream().map(e -> e.accept(this, null)).collect(Collectors.toList()))); | ||
| return format("%s.%s(%s):%s", call.getFunctionHandle().getFunctionNamespace(), call.getDisplayName(), String.join(", ", call.getArguments().stream().map(e -> e.accept(this, null)).collect(Collectors.toList())), call.getType()); |
Contributor
There was a problem hiding this comment.
probably good to have one parameter per line now? 😄
7 tasks
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 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.
Include CallExpression return type in canonicalized LambdaDefinitionExpression
so CAST with same input type would not be mistakenly canonicalized.