leekeiabstraction commented on code in PR #124:
URL: https://github.com/apache/fluss-rust/pull/124#discussion_r2675753238
##########
crates/fluss/src/row/datum.rs:
##########
@@ -55,6 +55,8 @@ pub enum Datum<'a> {
String(&'a str),
#[display("{0}")]
Blob(Blob),
+ #[display("{:?}")]
+ BorrowedBlob(&'a [u8]),
Review Comment:
I believe we need the owned variant for example for python -> rust binding.
I can use the Box::leak approach like below for string datum but am mindful
of the risk cause blobs can be significantly bigger
```
if let Ok(str_val) = value.extract::<String>(py) {
// Convert String to &'static str by leaking memory
// This is a simplified approach - in production, you might want
better lifetime management
let leaked_str: &'static str =
Box::leak(str_val.into_boxed_str());
return Ok(Datum::String(leaked_str));
}
```
What do you think?
--
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]