Add a simple optimization of LambdaExpression#18057
Merged
martint merged 2 commits intotrinodb:masterfrom Aug 12, 2023
Merged
Conversation
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: zhangyiqun.
|
ec1b485 to
a3fe246
Compare
fde8b2c to
e92b9e9
Compare
e92b9e9 to
5e351c8
Compare
martint
requested changes
Aug 9, 2023
Comment on lines
+291
to
+302
| assertOptimizedEquals("\"" + TryFunction.NAME + "\"(() -> 100 * 100)", | ||
| "\"" + TryFunction.NAME + "\"(() -> 10000)"); | ||
| assertOptimizedEquals("\"" + TryFunction.NAME + "\"(() -> CAST('123' as BIGINT))", | ||
| "\"" + TryFunction.NAME + "\"(() -> BIGINT '123')"); | ||
| assertOptimizedEquals("\"" + TryFunction.NAME + "\"(() -> CAST('abc' as BIGINT))", | ||
| "\"" + TryFunction.NAME + "\"(() -> CAST('abc' as BIGINT))"); | ||
| assertOptimizedEquals("\"" + TryFunction.NAME + "\"(() -> IF(false, 1, 0 / 0))", | ||
| "\"" + TryFunction.NAME + "\"(() -> 0 / 0)"); | ||
| assertOptimizedEquals("\"" + TryFunction.NAME + "\"(() -> 5 / 0)", | ||
| "\"" + TryFunction.NAME + "\"(() -> 5 / 0)"); | ||
| assertOptimizedEquals("\"" + TryFunction.NAME + "\"(() -> nullif(true, true))", | ||
| "\"" + TryFunction.NAME + "\"(() -> CAST(null AS Boolean))"); |
Member
There was a problem hiding this comment.
Rewrite these tests to use a function other that TryFunction.NAME, which is an internal implementation detail and not meant to be used directly. We don't want to introduce dependencies on it.
Member
Author
There was a problem hiding this comment.
Good catch, I replaced TryFunction.NAME with transform.
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.
Description
This pr is aimed at optimizing the body expressions in LambdaExpression using existing optimization capabilities.
Additional context and related issues
Release notes
(X) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text: