-
Notifications
You must be signed in to change notification settings - Fork 141
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
Decouple function repository and DSL from IoC container for use anywhere #1085
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>
Codecov Report
@@ Coverage Diff @@
## 2.x #1085 +/- ##
============================================
- Coverage 98.28% 96.44% -1.84%
+ Complexity 3435 2636 -799
============================================
Files 344 254 -90
Lines 8560 6972 -1588
Branches 544 521 -23
============================================
- Hits 8413 6724 -1689
- Misses 142 194 +52
- Partials 5 54 +49
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: Chen Dai <daichen@amazon.com>
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
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 <daichen@amazon.com>
91d4d5b
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
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 inFunctionRepository
which 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,
FunctionRepository
is managed by Spring container and inject to class who needs it.DSL
depends 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
WindowAssigner
needs 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
FunctionRepository
singleton 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.