Enum datafusion_sql::TableReference
source · pub enum TableReference<'a> {
Bare {
table: &'a str,
},
Partial {
schema: &'a str,
table: &'a str,
},
Full {
catalog: &'a str,
schema: &'a str,
table: &'a str,
},
}
Expand description
Represents a path to a table that may require further resolution
Variants§
Bare
An unqualified table reference, e.g. “table”
Partial
A partially resolved table reference, e.g. “schema.table”
Full
Fields
A fully resolved table reference, e.g. “catalog.schema.table”
Implementations§
source§impl<'a> TableReference<'a>
impl<'a> TableReference<'a>
sourcepub fn resolve(
self,
default_catalog: &'a str,
default_schema: &'a str
) -> ResolvedTableReference<'a>
pub fn resolve(
self,
default_catalog: &'a str,
default_schema: &'a str
) -> ResolvedTableReference<'a>
Given a default catalog and schema, ensure this table reference is fully resolved
sourcepub fn parse_str(s: &'a str) -> TableReference<'a>
pub fn parse_str(s: &'a str) -> TableReference<'a>
Forms a TableReference
by splitting s
on periods .
.
Note that this function does NOT handle periods or name
normalization correctly (e.g. "foo.bar"
will be parsed as
"foo
.bar"
. and Foo
will be parsed as Foo
(not foo
).
If you need to handle such identifiers correctly, you should
use a SQL parser or form the OwnedTableReference
directly.
See more detail in https://github.com/apache/arrow-datafusion/issues/4532
Trait Implementations§
source§impl<'a> Clone for TableReference<'a>
impl<'a> Clone for TableReference<'a>
source§fn clone(&self) -> TableReference<'a>
fn clone(&self) -> TableReference<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'a> Debug for TableReference<'a>
impl<'a> Debug for TableReference<'a>
source§impl<'a> From<&'a OwnedTableReference> for TableReference<'a>
impl<'a> From<&'a OwnedTableReference> for TableReference<'a>
Convert OwnedTableReference
into a TableReference
. Somewhat
akward to use but ‘idiomatic’: (&table_ref).into()
source§fn from(r: &'a OwnedTableReference) -> TableReference<'a>
fn from(r: &'a OwnedTableReference) -> TableReference<'a>
source§impl<'a> From<&'a str> for TableReference<'a>
impl<'a> From<&'a str> for TableReference<'a>
Parse a string into a TableReference, by splittig on .
See caveats on TableReference::parse_str