Skip to content

Commit f450e1d

Browse files
committed
Add note on limitations of arrow::compute::cast for schema transformations
1 parent 0ff4c0d commit f450e1d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/dataframe.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,11 @@ fn project_schema(from_schema: Schema, to_schema: Schema) -> Result<Schema, Arro
10851085

10861086
merged_schema.project(&project_indices)
10871087
}
1088-
1088+
// NOTE: `arrow::compute::cast` in combination with `RecordBatch::try_select` or
1089+
// DataFusion's `schema::cast_record_batch` do not fully cover the required
1090+
// transformations here. They will not create missing columns and may insert
1091+
// nulls for non-nullable fields without erroring. To maintain current behavior
1092+
// we perform the casting and null checks manually.
10891093
fn record_batch_into_schema(
10901094
record_batch: RecordBatch,
10911095
schema: &Schema,

0 commit comments

Comments
 (0)