feat: support ||, position and overlay bytea functions - #22076
Merged
Merged
Conversation
guluguluhhhh
force-pushed
the
support-bytea-functions
branch
from
June 2, 2025 11:40
7800f5e to
a03820c
Compare
Contributor
Author
|
@stdrc could you take a look when u r available😁 |
Contributor
There was a problem hiding this comment.
Pull Request Overview
Add support for bytea-specific SQL functions: concatenation (||), position, and overlay.
- Expose a new
ExprType::ByteaConcatOpin the planner and binder - Implement
bytea_concat_op,bytea_position,overlay_bytea, andoverlay_for_byteain the expression layer - Update
expr.prototo include the newBYTEA_CONCAT_OPnode
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/frontend/src/optimizer/plan_expr_visitor/strong.rs | Recognize ExprType::ByteaConcatOp in the planner |
| src/frontend/src/expr/pure.rs | Treat Type::ByteaConcatOp as a pure expression |
| src/frontend/src/binder/expr/binary_op.rs | Bind `bytea |
| src/expr/impl/src/scalar/position.rs | Add bytea_position function and basic tests |
| src/expr/impl/src/scalar/overlay.rs | Add overlay_bytea, overlay_for_bytea and tests |
| src/expr/impl/src/scalar/concat_op.rs | Add bytea_concat_op and tests |
| proto/expr.proto | Define BYTEA_CONCAT_OP in the protobuf enum |
Comments suppressed due to low confidence (2)
src/expr/impl/src/scalar/position.rs:79
- Add a unit test for the case where
sub_byteais empty to verify the function returns 1 as documented.
pub fn bytea_position(bytea: &[u8], sub_bytea: &[u8]) -> i32 {
src/expr/impl/src/scalar/overlay.rs:198
- Add a unit test that calls
overlay_bytea(..., start = 0)oroverlay_for_bytea(..., start = 0, ...)to confirm it returns the expectedInvalidParamerror.
if start <= 0 {
stdrc
approved these changes
Jun 9, 2025
stdrc
left a comment
Contributor
There was a problem hiding this comment.
Implementation LGTM! Thanks!
guluguluhhhh
force-pushed
the
support-bytea-functions
branch
from
June 10, 2025 07:28
a03820c to
1039726
Compare
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jun 10, 2025
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jun 10, 2025
8 tasks
3 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.
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
add support for ||, position and overlay bytea functions in #8831
Checklist
Documentation
Release note
support ||, position and overlay bytea functions