analytics-engine: More Math function support#21743
Conversation
PR Reviewer Guide 🔍(Review updated until commit 85764bb)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 85764bb
Previous suggestionsSuggestions up to commit ebacc88
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #21743 +/- ##
============================================
+ Coverage 73.46% 73.48% +0.02%
- Complexity 74825 74867 +42
============================================
Files 5997 5996 -1
Lines 339688 339679 -9
Branches 48961 48961
============================================
+ Hits 249558 249630 +72
+ Misses 70272 70248 -24
+ Partials 19858 19801 -57 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ger operands
- Add fp32/fp64 overloads to substrait `modulus` via opensearch_arithmetic_overloads.yaml
so isthmus can serialize MOD(fp, fp); ModAdapter widens mixed-type operands and wraps
in CASE for null-on-zero (isthmus can't thread on_domain_error=NULL).
- DivideAdapter wraps in CASE for null-on-zero (same isthmus option gap); short-circuits
on non-zero literal divisors.
- Wire conv(n, fromBase, toBase) end-to-end: ScalarFunction.CONVERT enum, ConvAdapter,
function mapping, opensearch_scalar_functions.yaml entry, Rust UDF in udf/conv.rs.
Mirrors Long.toString(Long.parseLong(...)) — lowercase output, NumberFormatException
message on invalid radix.
- Add NumericToDoubleAdapter entries for SIN/COS/TAN/ASIN/ACOS/ATAN/ATAN2/COT so
isthmus binds the call when PPL passes an integer field (substrait declares fp only).
- OpenSearchFilterRule: pass non-deterministic predicates (e.g. RAND() > 0) through to
child viable backends instead of throwing on zero field references.
Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
|
Persistent review updated to latest commit 85764bb |
| Map.entry(ScalarFunction.ACOS, new NumericToDoubleAdapter(SqlStdOperatorTable.ACOS)), | ||
| Map.entry(ScalarFunction.ASIN, new NumericToDoubleAdapter(SqlStdOperatorTable.ASIN)), | ||
| Map.entry(ScalarFunction.ATAN, new NumericToDoubleAdapter(SqlStdOperatorTable.ATAN)), | ||
| Map.entry(ScalarFunction.ATAN2, new NumericToDoubleAdapter(SqlStdOperatorTable.ATAN2)), |
There was a problem hiding this comment.
We will need similar adapters for RADIANS and DEGREES
I think we need similar fix for them as well. We need to convert the arguments in those functions to Double as well.
please add
Map.entry(ScalarFunction.RADIANS, new NumericToDoubleAdapter(SqlStdOperatorTable.RADIANS)),
Map.entry(ScalarFunction.DEGREES, new NumericToDoubleAdapter(SqlStdOperatorTable.DEGREES)),
Description
Brings PPL scalar function coverage on the analytics-engine route up to parity.
Arithmetic
Trigonometric
Base conversion
Predicates
No new PPL syntax — these are existing PPL functions that were silently failing or throwing on the analytics-engine route. Users gain consistent behavior whether their query hits the analytics path.
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
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.