charlesdong1991 commented on code in PR #433:
URL: https://github.com/apache/fluss-rust/pull/433#discussion_r2901703367


##########
crates/fluss/src/row/column.rs:
##########
@@ -407,17 +407,115 @@ impl InternalRow for ColumnarRow {
             })?
             .value(self.row_id))
     }
+
+    fn get_array(&self, pos: usize) -> Result<crate::row::FlussArray> {
+        use crate::record::from_arrow_type;
+        use crate::row::binary_array::FlussArrayWriter;
+        use arrow::array::ListArray;
+
+        let column = self.column(pos)?;
+        let list_array =
+            column
+                .as_any()
+                .downcast_ref::<ListArray>()
+                .ok_or_else(|| IllegalArgument {
+                    message: format!("expected List array at position {pos}"),
+                })?;
+
+        let values = list_array.value(self.row_id);
+        let num_elements = values.len();
+        let element_arrow_type = values.data_type();
+        let element_fluss_type = from_arrow_type(element_arrow_type)?;
+
+        let mut writer = FlussArrayWriter::new(num_elements, 
&element_fluss_type);
+        let element_row = ColumnarRow::new(std::sync::Arc::new(
+            arrow::array::RecordBatch::try_from_iter(vec![("v", 
values)]).map_err(|e| {
+                IllegalArgument {
+                    message: format!("Failed to create RecordBatch from list 
values: {e}"),
+                }
+            })?,
+        ));

Review Comment:
   updated!



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