Akanksha-kedia opened a new pull request, #18790:
URL: https://github.com/apache/pinot/pull/18790

   ## Summary
   
   Implements the SQL standard `OVERLAY(string PLACING replacement FROM start 
[FOR length])` scalar function.
   
   - When `length` is omitted it defaults to `len(replacement)`, matching 
PostgreSQL, Trino, and DuckDB
   - Two overloads registered: `overlay(str, replacement, start)` and 
`overlay(str, replacement, start, length)`
   - Handles edge cases: zero-length deletion (insertion), `start` beyond end 
(append), `length` clamped to remaining string
   
   ```sql
   SELECT OVERLAY('hello world' PLACING 'there' FROM 7)       -- 'hello there'
   SELECT OVERLAY('abcdef' PLACING 'XY' FROM 3 FOR 0)          -- 'abXYcdef'
   SELECT OVERLAY('abcdef' PLACING 'XY' FROM 3 FOR 4)          -- 'abXYf'
   ```
   
   Follows the same pattern as the recently added `TRANSLATE` function.
   
   ## Test plan
   
   - [ ] `StringFunctionsTest#testOverlay` — 11 unit tests covering basic 
replacement, insertion, deletion, clamping, empty inputs
   
   🤖 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