sql
sql copied to clipboard
Refactor implementation of relevance queries
Description
- Simplified function resolution for relevance query functions.
- Throw a
SemanticCheckExceptionfromRelevanceQuery::buildif a parameter is specified more than once. Combined with (1), the end user gets a much better error message. - Introduced
MultiFieldQueryandSingleFieldQuery. This allowed for cleaner code in derived classes. - Removed duplicated code from
MultiMatchQueryandQueryStringQuery. These functions now throw aSyntaxCheckExceptionif called with insufficient number of parameters. This is in line with other query functions.
Check List
- [x] New functionality includes testing.
- [x] All tests pass, including unit test, integration test and doctest
- [x] Commits are signed per the DCO using --signoff
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.
Codecov Report
Merging #746 (0f13069) into main (29f1c52) will decrease coverage by
0.02%. The diff coverage is100.00%.
@@ Coverage Diff @@
## main #746 +/- ##
============================================
- Coverage 94.78% 94.76% -0.03%
- Complexity 2880 2884 +4
============================================
Files 286 289 +3
Lines 7735 7699 -36
Branches 565 562 -3
============================================
- Hits 7332 7296 -36
Misses 349 349
Partials 54 54
| Flag | Coverage Δ | |
|---|---|---|
| query-workbench | 62.76% <ø> (ø) |
|
| sql-engine | 97.75% <100.00%> (-0.02%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...arch/sql/expression/datetime/DateTimeFunction.java | 100.00% <ø> (ø) |
|
| ...search/sql/expression/datetime/IntervalClause.java | 100.00% <ø> (ø) |
|
| ...expression/function/BuiltinFunctionRepository.java | 100.00% <ø> (ø) |
|
| ...ression/operator/arthmetic/ArithmeticFunction.java | 100.00% <ø> (ø) |
|
| ...ssion/operator/arthmetic/MathematicalFunction.java | 100.00% <ø> (ø) |
|
| .../expression/operator/convert/TypeCastOperator.java | 100.00% <ø> (ø) |
|
| ...on/operator/predicate/BinaryPredicateOperator.java | 100.00% <ø> (ø) |
|
| ...g/opensearch/sql/expression/text/TextFunction.java | 100.00% <ø> (ø) |
|
| ...sql/expression/aggregation/AggregatorFunction.java | 100.00% <100.00%> (ø) |
|
| ...l/expression/function/DefaultFunctionResolver.java | 100.00% <100.00%> (ø) |
|
| ... and 15 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.