linguoxuan commented on code in PR #205:
URL: https://github.com/apache/fluss-rust/pull/205#discussion_r2725614521


##########
crates/fluss/src/row/column.rs:
##########
@@ -253,16 +331,33 @@ impl InternalRow for ColumnarRow {
     }
 
     fn get_char(&self, pos: usize, _length: usize) -> &str {
-        let array = self
-            .record_batch
-            .column(pos)
-            .as_any()
-            .downcast_ref::<FixedSizeBinaryArray>()
-            .expect("Expected fixed-size binary array for char type");
+        let column = self.record_batch.column(pos);
+        let schema = self.record_batch.schema();
+        let arrow_field = schema.field(pos);
 
-        let bytes = array.value(self.row_id);
-        // don't check length, following java client
-        std::str::from_utf8(bytes).expect("Invalid UTF-8 in char field")
+        match arrow_field.data_type() {
+            ArrowDataType::FixedSizeBinary(_) => {
+                // KV table format: char stored as FixedSizeBinary

Review Comment:
   @luoyuxia Hi, sorry for the misleading in my previous code and comment!
   
   You're absolutely right to question this. The truth is: Looking at the 
to_arrow_type function in arrow.rs, DataType::Char(_) is consistently mapped to 
ArrowDataType::Utf8 for all table types. So The get_char() method should read 
data from StringArray, not FixedSizeBinaryArray. Thanks for pointing this out! 
I have pushed a new commit.



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