Build a BinaryRow from selected columns of an Arrow RecordBatch at a given row. `field_indices` maps each position in the output BinaryRow to a column index in the batch; `fields` provides the Paimon DataField metadata for every column in the schema (indexed by the same column indices).
(
batch: &RecordBatch,
row_idx: usize,
field_indices: &[usize],
fields: &[crate::spec::DataField],
)
| 349 | /// in the batch; `fields` provides the Paimon DataField metadata for every column |
| 350 | /// in the schema (indexed by the same column indices). |
| 351 | pub fn from_arrow( |
| 352 | batch: &RecordBatch, |
| 353 | row_idx: usize, |
| 354 | field_indices: &[usize], |
| 355 | fields: &[crate::spec::DataField], |
| 356 | ) -> crate::Result<Self> { |
| 357 | let arity = field_indices.len() as i32; |
| 358 | let mut builder = BinaryRowBuilder::new(arity); |
| 359 | for (pos, &field_idx) in field_indices.iter().enumerate() { |
| 360 | let field = &fields[field_idx]; |
| 361 | match extract_datum_from_arrow(batch, row_idx, field_idx, field.data_type())? { |
| 362 | Some(datum) => builder.write_datum(pos, &datum, field.data_type()), |
| 363 | None => builder.set_null_at(pos), |
| 364 | } |
| 365 | } |
| 366 | Ok(builder.build()) |
| 367 | } |
| 368 | |
| 369 | /// Build a BinaryRow from typed Datum values using `BinaryRowBuilder`. |
| 370 | /// `None` entries are written as null fields. |
nothing calls this directly
no test coverage detected