mayankshriv opened a new pull request, #18420:
URL: https://github.com/apache/pinot/pull/18420

   ## Summary
   
   Adds 15 scalar functions to improve SQL standard compliance and close gaps 
with PostgreSQL. Follows up on #18409 which added the first batch of math, 
string, and IP address functions. No new dependencies.
   
   | Category | Function | Aliases | Description |
   |---|---|---|---|
   | **Trig** | `asinh(double)` | | Inverse hyperbolic sine |
   | | `acosh(double)` | | Inverse hyperbolic cosine (domain: x >= 1) |
   | | `atanh(double)` | | Inverse hyperbolic tangent (domain: -1 < x < 1) |
   | **Math** | `factorial(long)` | | n! via precomputed lookup (0–20) |
   | | `widthBucket(v, lo, hi, n)` | `width_bucket` | SQL standard histogram 
bucketing |
   | **String** | `overlay(s, r, pos, len)` | | SQL standard OVERLAY |
   | | `octetLength(s)` | `octet_length` | Byte count of UTF-8 encoding |
   | | `bitLength(s)` | `bit_length` | Bit count of UTF-8 encoding |
   | | `charLength(s)` | `char_length`, `character_length` | Unicode codepoint 
count |
   | | `regexpCount(s, pat)` | `regexp_count` | Count non-overlapping regex 
matches |
   | | `regexpSubstr(s, pat)` | `regexp_substr` | First regex match or null |
   | **IP** | `ipFamily(s)` | `ip_family` | Returns 4 or 6 |
   | | `ipMaskLen(cidr)` | `ip_mask_len` | Extract prefix length from CIDR |
   | | `ipNetmask(cidr)` | `ip_netmask` | Network mask (e.g., `255.255.255.0`) |
   | | `ipHostmask(cidr)` | `ip_hostmask` | Host mask (e.g., `0.0.0.255`) |
   
   ## Test plan
   
   - [ ] `./mvnw -pl pinot-common -am 
-Dtest="TrigonometricFunctionsTest,ArithmeticFunctionsTest,StringFunctionsTest,IpAddressFunctionsTest"
 -Dsurefire.failIfNoSpecifiedTests=false test`
   - [ ] Verify edge cases: NaN/Infinity for widthBucket, negative len for 
overlay, domain violations for acosh/atanh, IPv6 netmask/hostmask
   - [ ] spotless, checkstyle, license checks pass
   - [ ] Zero compiler warnings
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to