pub trait DataTypeExt {
// Required methods
fn into_nullable_field(self) -> Field;
fn into_nullable_field_ref(self) -> FieldRef;
}Expand description
DataFusion extension methods for Arrow DataType
Required Methods§
Sourcefn into_nullable_field(self) -> Field
fn into_nullable_field(self) -> Field
Convert the type to field with nullable type and “” name
This is used to track the places where we convert a DataType
into a nameless field to interact with an API that is
capable of representing an extension type and/or nullability.
For example, it will convert a DataType::Int32 into
Field::new("", DataType::Int32, true).
let dt = DataType::Utf8;
let field = dt.into_nullable_field();
// result is a nullable Utf8 field with "" name
assert_eq!(field.name(), "");
assert_eq!(field.data_type(), &DataType::Utf8);
assert!(field.is_nullable());Sourcefn into_nullable_field_ref(self) -> FieldRef
fn into_nullable_field_ref(self) -> FieldRef
Convert the type to FieldRef with nullable type and “” name
Concise wrapper around DataTypeExt::into_nullable_field that
constructs a FieldRef.