Add scalar functions: math, IP address, and string utilities#18409
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18409 +/- ##
============================================
- Coverage 63.54% 63.51% -0.04%
Complexity 1709 1709
============================================
Files 3254 3254
Lines 199181 199244 +63
Branches 30851 30863 +12
============================================
- Hits 126567 126546 -21
- Misses 62498 62612 +114
+ Partials 10116 10086 -30
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:
|
Math (8 functions): cbrt, exp2, exp10, log1p, sigmoid, pi, e, bitCount. IP address (8 functions): isIPv4String, isIPv6String, ipv4ToLong, longToIpv4, ipv6ToBytes, bytesToIpv6, ipv4ToIpv6, ipv4CIDRToRange. String (7 functions): ascii, space, substringIndex, firstLine, startsWithCaseInsensitive, endsWithCaseInsensitive, isValidASCII. Includes unit tests and transform function wrapper tests for all 23 functions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
56a80ad to
9038639
Compare
xiangfu0
approved these changes
May 4, 2026
Contributor
|
Opened the matching docs PR: pinot-contrib/pinot-docs#789 |
xiangfu0
added a commit
to pinot-contrib/pinot-docs
that referenced
this pull request
May 4, 2026
## Summary - documents the new scalar math, string, and IP address functions added by apache/pinot#18409 on the existing category pages - adds the same functions to the query function index so readers can discover them from the A-Z reference ## Source cross-checks - verified signatures, aliases, and return types against `pinot-common` scalar function implementations - verified examples and edge-case wording against `ArithmeticFunctionsTest`, `IpAddressFunctionsTest`, `StringFunctionsTest`, and `ScalarTransformFunctionWrapperTest` in the local `apache/pinot` checkout ## Validation - `git diff --check`
4 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.
Summary
Adds 23 new
@ScalarFunctionmethods. No new dependencies — all implementations use libraries already on the classpath. All functions are stateless, thread-safe, and auto-registered viaFunctionRegistry.cbrt(x)exp2(x)power(2,x))exp10(x)power(10,x))log1p(x)sigmoid(x)pi()e()/euler()bitCount(x)isIPv4String(s)isIPv6String(s)ipv4ToLong(s)longToIpv4(x)ipv6ToBytes(s)bytesToIpv6(b)ipv4ToIpv6(s)ipv4CIDRToRange(s)ascii(s)space(n)repeat(' ',n))substringIndex(s,d,n)firstLine(s)startsWithCaseInsensitive(s,p)endsWithCaseInsensitive(s,p)isValidASCII(s)Test plan
ArithmeticFunctionsTest(new),IpAddressFunctionsTest,StringFunctionsTest— edge cases include NaN, Infinity, boundary values, round-trip conversions, invalid inputsScalarTransformFunctionWrapperTest— verifies each function works end-to-end throughScalarTransformFunctionWrapperwith segment dataDocumentation
Documentation updates to pinot-docs will follow once this PR is merged.
🤖 Generated with Claude Code