-
Notifications
You must be signed in to change notification settings - Fork 533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(expr): add missing basic exprs for timestamptz
and bytea
#10462
Conversation
Codecov Report
@@ Coverage Diff @@
## main #10462 +/- ##
==========================================
- Coverage 70.51% 70.50% -0.01%
==========================================
Files 1260 1260
Lines 215075 215113 +38
==========================================
+ Hits 151651 151670 +19
- Misses 63424 63443 +19
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 5 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
#[function("octet_length(varchar) -> int32")] | ||
pub fn octet_length(s: &str) -> i32 { | ||
pub fn octet_length_str(s: &str) -> i32 { | ||
s.as_bytes().len() as i32 | ||
} | ||
|
||
#[function("length(bytea) -> int32")] | ||
#[function("octet_length(bytea) -> int32")] | ||
pub fn octet_length_bytea(s: &[u8]) -> i32 { | ||
s.len() as i32 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tip: You can use generic function to unify them.
#[function("length(bytea) -> int32")]
#[function("octet_length(bytea) -> int32")]
#[function("octet_length(varchar) -> int32")]
pub fn octet_length(s: impl AsRef<[u8]>) -> i32 {
s.as_ref().len() as i32
}
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Added:
timestamptz - timestamptz = interval
(resolves bug:timestamptz - timestamptz = interval
unimplemented #9906)bytea CMP bytea = bool
whereCMP
is=
,<>
(!=
),<
,<=
,>
,>=
,is [not] distinct from
cast(bytea) = varchar
octet_length(bytea) = int32
(same aslength(bytea)
)bit_length(bytea) = int32
Not added:
jsonb CMP jsonb
(not meaningful, and ourOrd
is different from PG)cast(struct) = varchar
(buggy Different display format for array/struct with pg #4769)cast(varchar) = struct
(less useful expr: string to struct cast #7369)bytea
functions (egposition
,substr
,||
)Checklist
./risedev check
(or alias,./risedev c
)Documentation
Types of user-facing changes
Release note
Support some basic exprs for
timestamptz
andbytea
:timestamptz - timestamptz = interval
bytea CMP bytea = bool
whereCMP
is=
,<>
(!=
),<
,<=
,>
,>=
,is [not] distinct from
cast(bytea) = varchar
octet_length(bytea) = int32
(same aslength(bytea)
)bit_length(bytea) = int32