fresh-borzoni commented on code in PR #175:
URL: https://github.com/apache/fluss-rust/pull/175#discussion_r2702321302
##########
crates/fluss/src/row/binary/binary_writer.rs:
##########
@@ -30,36 +30,48 @@ pub trait BinaryWriter {
/// Set null to this field
fn set_null_at(&mut self, pos: usize);
- fn write_boolean(&mut self, value: bool);
+ fn write_boolean(&mut self, value: bool) -> Result<()>;
- fn write_byte(&mut self, value: u8);
+ fn write_byte(&mut self, value: u8) -> Result<()>;
- fn write_bytes(&mut self, value: &[u8]);
+ fn write_bytes(&mut self, value: &[u8]) -> Result<()>;
- fn write_char(&mut self, value: &str, length: usize);
+ fn write_char(&mut self, value: &str, length: usize) -> Result<()>;
- fn write_string(&mut self, value: &str);
+ fn write_string(&mut self, value: &str) -> Result<()>;
- fn write_short(&mut self, value: i16);
+ fn write_short(&mut self, value: i16) -> Result<()>;
- fn write_int(&mut self, value: i32);
+ fn write_int(&mut self, value: i32) -> Result<()>;
- fn write_long(&mut self, value: i64);
+ fn write_long(&mut self, value: i64) -> Result<()>;
- fn write_float(&mut self, value: f32);
+ fn write_float(&mut self, value: f32) -> Result<()>;
- fn write_double(&mut self, value: f64);
+ fn write_double(&mut self, value: f64) -> Result<()>;
- fn write_binary(&mut self, bytes: &[u8], length: usize);
+ fn write_binary(&mut self, bytes: &[u8], length: usize) -> Result<()>;
- // TODO Decimal type
- // fn write_decimal(&mut self, pos: i32, value: f64);
+ fn write_decimal(
+ &mut self,
+ value: &bigdecimal::BigDecimal,
+ precision: u32,
+ scale: u32,
+ ) -> Result<()>;
- // TODO Timestamp type
- // fn write_timestamp_ntz(&mut self, pos: i32, value: i64);
+ fn write_time(&mut self, value: i32, precision: u32) -> Result<()>;
Review Comment:
Java uses `writeInt` to write time, I don't like it, so I prefer more
explicit way here. Now it's better semantically and allows some flexibility in
the future.
--
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]