We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c66a3d commit dbf1430Copy full SHA for dbf1430
1 file changed
datafusion/functions/src/core/getfield.rs
@@ -413,14 +413,16 @@ impl ScalarUDFImpl for GetFieldFunc {
413
plan_datafusion_err!("Field {field_name} not found in struct")
414
})?;
415
416
- let nullable =
417
- current_field.is_nullable() || child_field.is_nullable();
418
let dict_type = DataType::Dictionary(
419
key_type.clone(),
420
Box::new(child_field.data_type().clone()),
421
);
422
- current_field =
423
- Arc::new(Field::new(child_field.name(), dict_type, nullable));
+ let mut new_field =
+ child_field.as_ref().clone().with_data_type(dict_type);
+ if current_field.is_nullable() {
+ new_field = new_field.with_nullable(true);
424
+ }
425
+ current_field = Arc::new(new_field);
426
}
427
DataType::Struct(fields) => {
428
let field_name = sv
0 commit comments