Decouple function repository and DSL from IoC container for use anywhere#1085
Merged
dai-chen merged 8 commits intoopensearch-project:2.xfrom Nov 17, 2022
Merged
Conversation
Signed-off-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai <daichen@amazon.com>
This was referenced Nov 17, 2022
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (95.73%) is below the target coverage (99.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## 2.x #1085 +/- ##
============================================
- Coverage 98.28% 95.73% -2.55%
+ Complexity 3435 3434 -1
============================================
Files 344 353 +9
Lines 8560 9198 +638
Branches 544 663 +119
============================================
+ Hits 8413 8806 +393
- Misses 142 334 +192
- Partials 5 58 +53
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Chen Dai <daichen@amazon.com>
Collaborator
Author
|
@Yury-Fridlyand Please confirm if the previous issues you mentioned in the old PR are gone. Will try to merge this today to unblock others. Thanks! |
Yury-Fridlyand
previously approved these changes
Nov 17, 2022
core/src/test/java/org/opensearch/sql/planner/physical/PhysicalPlanTestBase.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Chen Dai <daichen@amazon.com>
91d4d5b
derek-ho
reviewed
Nov 17, 2022
6 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.
Description
!!!NOTE!!! Please ignore most file changes as they're all changing instance method to static method call on
DSL. The only change matters is inFunctionRepositorywhich becomes a singleton after this.Problem Statement
The performance issue is improved in #944, this PR is focused on the functionality and our own DSL language adoption problem.
Currently,
FunctionRepositoryis managed by Spring container and inject to class who needs it.DSLdepends on the function repository to resolve function signature as well. This causes the function repository or DSL instance passed around and leads to "ugly" code as below:Besides, the bigger problem is it blocks high level physical operator from building custom logic on top of the expression system. For example, the new
WindowAssignerneeds to calculate the lower bound of a window as below. The current coupling with Spring container make it hard to implement:Solution
After double check, make
FunctionRepositorysingleton as well asDSL. This makes both can be reused anywhere.TODO
Further Thoughts
ExprValue? ex.val1.add(val2)rather thanDSL.add(val1, val2).valueOf(null)<= Not sure. Maybe we should.Issues Resolved
#944
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.