Struct datafusion_common::DFSchema
source · [−]pub struct DFSchema { /* private fields */ }
Expand description
DFSchema wraps an Arrow schema and adds relation names
Implementations
sourceimpl DFSchema
impl DFSchema
sourcepub fn new(fields: Vec<DFField>) -> Result<Self>
👎 Deprecated since 7.0.0: please use new_with_metadata
instead
pub fn new(fields: Vec<DFField>) -> Result<Self>
please use new_with_metadata
instead
Create a new DFSchema
sourcepub fn new_with_metadata(
fields: Vec<DFField>,
metadata: HashMap<String, String>
) -> Result<Self>
pub fn new_with_metadata(
fields: Vec<DFField>,
metadata: HashMap<String, String>
) -> Result<Self>
Create a new DFSchema
sourcepub fn try_from_qualified_schema(
qualifier: &str,
schema: &Schema
) -> Result<Self>
pub fn try_from_qualified_schema(
qualifier: &str,
schema: &Schema
) -> Result<Self>
Create a DFSchema
from an Arrow schema
sourcepub fn join(&self, schema: &DFSchema) -> Result<Self>
pub fn join(&self, schema: &DFSchema) -> Result<Self>
Create a new schema that contains the fields from this schema followed by the fields from the supplied schema. An error will be returned if there are duplicate field names.
sourcepub fn merge(&mut self, other_schema: &DFSchema)
pub fn merge(&mut self, other_schema: &DFSchema)
Modify this schema by appending the fields from the supplied schema, ignoring any duplicate fields.
sourcepub fn fields(&self) -> &Vec<DFField>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn fields(&self) -> &Vec<DFField>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Get a list of fields
sourcepub fn field(&self, i: usize) -> &DFField
pub fn field(&self, i: usize) -> &DFField
Returns an immutable reference of a specific Field
instance selected using an
offset within the internal fields
vector
sourcepub fn index_of(&self, name: &str) -> Result<usize>
👎 Deprecated since 8.0.0: please use index_of_column_by_name
instead
pub fn index_of(&self, name: &str) -> Result<usize>
please use index_of_column_by_name
instead
Find the index of the column with the given unqualified name
pub fn index_of_column_by_name(
&self,
qualifier: Option<&str>,
name: &str
) -> Result<usize>
sourcepub fn index_of_column(&self, col: &Column) -> Result<usize>
pub fn index_of_column(&self, col: &Column) -> Result<usize>
Find the index of the column with the given qualifier and name
sourcepub fn field_with_name(
&self,
qualifier: Option<&str>,
name: &str
) -> Result<&DFField>
pub fn field_with_name(
&self,
qualifier: Option<&str>,
name: &str
) -> Result<&DFField>
Find the field with the given name
sourcepub fn fields_with_qualified(&self, qualifier: &str) -> Vec<&DFField>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn fields_with_qualified(&self, qualifier: &str) -> Vec<&DFField>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Find all fields having the given qualifier
sourcepub fn fields_with_unqualified_name(&self, name: &str) -> Vec<&DFField>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn fields_with_unqualified_name(&self, name: &str) -> Vec<&DFField>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Find all fields match the given name
sourcepub fn field_with_unqualified_name(&self, name: &str) -> Result<&DFField>
pub fn field_with_unqualified_name(&self, name: &str) -> Result<&DFField>
Find the field with the given name
sourcepub fn field_with_qualified_name(
&self,
qualifier: &str,
name: &str
) -> Result<&DFField>
pub fn field_with_qualified_name(
&self,
qualifier: &str,
name: &str
) -> Result<&DFField>
Find the field with the given qualified name
sourcepub fn field_from_column(&self, column: &Column) -> Result<&DFField>
pub fn field_from_column(&self, column: &Column) -> Result<&DFField>
Find the field with the given qualified column
sourcepub fn matches_arrow_schema(&self, arrow_schema: &Schema) -> bool
pub fn matches_arrow_schema(&self, arrow_schema: &Schema) -> bool
Check to see if unqualified field names matches field names in Arrow schema
sourcepub fn check_arrow_schema_type_compatible(
&self,
arrow_schema: &Schema
) -> Result<()>
pub fn check_arrow_schema_type_compatible(
&self,
arrow_schema: &Schema
) -> Result<()>
Check to see if fields in 2 Arrow schemas are compatible
sourcepub fn strip_qualifiers(self) -> Self
pub fn strip_qualifiers(self) -> Self
Strip all field qualifier in schema
sourcepub fn replace_qualifier(self, qualifier: &str) -> Self
pub fn replace_qualifier(self, qualifier: &str) -> Self
Replace all field qualifier with new value in schema
Trait Implementations
sourceimpl ExprSchema for DFSchema
impl ExprSchema for DFSchema
sourceimpl PartialEq<DFSchema> for DFSchema
impl PartialEq<DFSchema> for DFSchema
impl Eq for DFSchema
impl StructuralEq for DFSchema
impl StructuralPartialEq for DFSchema
Auto Trait Implementations
impl RefUnwindSafe for DFSchema
impl Send for DFSchema
impl Sync for DFSchema
impl Unpin for DFSchema
impl UnwindSafe for DFSchema
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.