Skip to content

Commit ba71eea

Browse files
ZENOTMEZENOTME
and
ZENOTME
authored
feat: support arrow_struct_to_iceberg_struct (#731)
This PR introduces the function to convert arrow struct to iceberg struct. This function is needed when we add fanout partition writer: In this writer, we need to compute the partition value using record batch and convert them into struct value finally and set into data file. --------- Co-authored-by: ZENOTME <[email protected]>
1 parent eb4c668 commit ba71eea

File tree

6 files changed

+1399
-4
lines changed

6 files changed

+1399
-4
lines changed

crates/iceberg/src/arrow/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ pub use schema::*;
2222
mod reader;
2323
pub(crate) mod record_batch_projector;
2424
pub(crate) mod record_batch_transformer;
25-
25+
mod value;
2626
pub use reader::*;
27+
pub use value::*;

crates/iceberg/src/arrow/schema.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ pub fn arrow_type_to_type(ty: &DataType) -> Result<Type> {
226226

227227
const ARROW_FIELD_DOC_KEY: &str = "doc";
228228

229-
fn get_field_id(field: &Field) -> Result<i32> {
229+
pub(super) fn get_field_id(field: &Field) -> Result<i32> {
230230
if let Some(value) = field.metadata().get(PARQUET_FIELD_ID_META_KEY) {
231231
return value.parse::<i32>().map_err(|e| {
232232
Error::new(

0 commit comments

Comments
 (0)