-
Notifications
You must be signed in to change notification settings - Fork 180
Decouple function repository and DSL from IoC container for use anywhere #1085
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
Decouple function repository and DSL from IoC container for use anywhere #1085
Conversation
Signed-off-by: Chen Dai <[email protected]>
Signed-off-by: Chen Dai <[email protected]>
Signed-off-by: Chen Dai <[email protected]>
Signed-off-by: Chen Dai <[email protected]>
Signed-off-by: Chen Dai <[email protected]>
Signed-off-by: Chen Dai <[email protected]>
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 <[email protected]>
acarbonetto
left a comment
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.
LGTM
penghuo
left a comment
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.
Thanks
|
@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! |
core/src/test/java/org/opensearch/sql/planner/physical/PhysicalPlanTestBase.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Chen Dai <[email protected]>
91d4d5b
derek-ho
left a comment
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.
LGTM
penghuo
left a comment
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.
Thanks.
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.