leekeiabstraction commented on code in PR #433: URL: https://github.com/apache/fluss-rust/pull/433#discussion_r2902411024
########## crates/fluss/src/row/encode/compacted_key_encoder.rs: ########## Review Comment: I vaguely remember that Java side does encode array. See this PR which was created to give us a way to check that compacted key encoding is consistent across both Java and Rust https://github.com/apache/fluss/pull/2312/files ########## crates/fluss/src/record/arrow.rs: ########## @@ -1184,6 +1188,71 @@ pub fn to_arrow_type(fluss_type: &DataType) -> Result<ArrowDataType> { }) } +/// Converts an Arrow data type back to a Fluss `DataType`. +/// Used for reading array elements from Arrow ListArray back into Fluss types. +pub fn from_arrow_type(arrow_type: &ArrowDataType) -> Result<DataType> { Review Comment: Should this be pub (crate)? Also, have you check if there is an already existing function that does something similar? (Reads familiar but I do not have access to codebase right now) ########## crates/fluss/src/record/arrow.rs: ########## @@ -330,6 +330,10 @@ impl RowAppendRecordBatchBuilder { arrow_schema::DataType::Timestamp(arrow_schema::TimeUnit::Second, _) => { Ok(Box::new(TimestampSecondBuilder::with_capacity(capacity))) } + arrow_schema::DataType::List(field) => { + let inner_builder = Self::create_builder(field.data_type(), capacity)?; + Ok(Box::new(ListBuilder::with_capacity(inner_builder, capacity))) Review Comment: This reads like we are over provisioning here with capacity^2? -- 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]
