leekeiabstraction commented on code in PR #144:
URL: https://github.com/apache/fluss-rust/pull/144#discussion_r2680086852


##########
crates/fluss/src/row/compacted/compacted_row_writer.rs:
##########
@@ -153,4 +153,21 @@ impl CompactedRowWriter {
     pub fn write_double(&mut self, value: f64) {
         self.write_raw(&value.to_ne_bytes());
     }
+
+    pub fn write_decimal(&mut self, value: &rust_decimal::Decimal, _precision: 
u32) {
+        // For now, serialize decimal to its string representation and write 
as bytes
+        // TODO: implement compact decimal encoding based on precision similar 
to Java implementation
+        let s = value.to_string();
+        self.write_bytes(s.as_bytes());

Review Comment:
   We should really have an implementation is consistent with Java's for this 
task.



##########
crates/fluss/src/row/compacted/compacted_row_writer.rs:
##########
@@ -153,4 +153,21 @@ impl CompactedRowWriter {
     pub fn write_double(&mut self, value: f64) {
         self.write_raw(&value.to_ne_bytes());
     }
+
+    pub fn write_decimal(&mut self, value: &rust_decimal::Decimal, _precision: 
u32) {
+        // For now, serialize decimal to its string representation and write 
as bytes
+        // TODO: implement compact decimal encoding based on precision similar 
to Java implementation
+        let s = value.to_string();
+        self.write_bytes(s.as_bytes());
+    }
+
+    pub fn write_timestamp_ntz(&mut self, value: i64, _precision: u32) {
+        // Currently write timestamp as a long (epoch millis or other unit 
depending on upstream)
+        self.write_long(value);

Review Comment:
   We should really have an implementation is consistent with Java's for this 
task.



-- 
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]

Reply via email to