Struct datafusion::prelude::Column
source · pub struct Column {
pub relation: Option<String>,
pub name: String,
}
Expand description
A named reference to a qualified field in a schema.
Fields§
§relation: Option<String>
relation/table name.
name: String
field/column name.
Implementations§
source§impl Column
impl Column
sourcepub fn new(
relation: Option<impl Into<String>>,
name: impl Into<String>
) -> Column
pub fn new( relation: Option<impl Into<String>>, name: impl Into<String> ) -> Column
Create Column from optional qualifier and name
sourcepub fn from_qualified_name(flat_name: impl Into<String>) -> Column
pub fn from_qualified_name(flat_name: impl Into<String>) -> Column
Deserialize a fully qualified name string into a column
sourcepub fn normalize_with_schemas(
self,
schemas: &[&Arc<DFSchema>],
using_columns: &[HashSet<Column, RandomState>]
) -> Result<Column, DataFusionError>
pub fn normalize_with_schemas( self, schemas: &[&Arc<DFSchema>], using_columns: &[HashSet<Column, RandomState>] ) -> Result<Column, DataFusionError>
Qualify column if not done yet.
If this column already has a relation, it will be returned as is and the given parameters are ignored. Otherwise this will search through the given schemas to find the column. This will use the first schema that matches.
A schema matches if there is a single column that – when unqualified – matches this column. There is an
exception for USING
statements, see below.
Using columns
Take the following SQL statement:
SELECT id FROM t1 JOIN t2 USING(id)
In this case, both t1.id
and t2.id
will match unqualified column id
. To express this possibility, use
using_columns
. Each entry in this array is a set of columns that are bound together via a USING
clause. So
in this example this would be [{t1.id, t2.id}]
.
Trait Implementations§
source§impl Ord for Column
impl Ord for Column
source§impl PartialEq<Column> for Column
impl PartialEq<Column> for Column
source§impl PartialOrd<Column> for Column
impl PartialOrd<Column> for Column
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Column
impl StructuralEq for Column
impl StructuralPartialEq for Column
Auto Trait Implementations§
impl RefUnwindSafe for Column
impl Send for Column
impl Sync for Column
impl Unpin for Column
impl UnwindSafe for Column
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.