Skip to main content

TableFunction

Enum TableFunction 

Source
pub enum TableFunction {
    Range,
    GenerateSeries,
    ReadParquet,
    ReadCsv,
}
Expand description

Which table function a call resolved to.

An enum rather than a name, because the executor dispatches on this and a string comparison per operator build is a string comparison that can be spelled wrong.

Variants§

§

Range

range(stop), range(start, stop), range(start, stop, step), stopping before the end.

§

GenerateSeries

The same three, stopping on the end.

§

ReadParquet

read_parquet(path), the rows of a Parquet file.

§

ReadCsv

read_csv(path), the rows of a CSV file, with everything about how it is written sniffed.

Implementations§

Source§

impl TableFunction

Source

pub const fn name(self) -> &'static str

The name the plan records and an error message says.

Source

pub const fn inclusive(self) -> bool

Whether the last value is produced.

Only the two series functions differ here. The file readers answer false and nothing asks them.

Source

pub fn parameters(self) -> &'static [(&'static str, LogicalType)]

The named parameters the call takes, and the type each one wants.

This is the list rudb acts on and not the list DuckDB prints, and the difference is worth being plain about. read_parquet there takes seventeen named parameters and read_csv takes around thirty. One of the Parquet ones is on the critical path, since the ClickBench entry reads its file with binary_as_string=True and without it every string column in hits.parquet comes back as BLOB, and the other sixteen have no caller here yet. A parameter that is listed is one that does something, so this list grows as they land rather than accepting names and ignoring them, which is the failure mode that makes an option look supported when it is not.

The CSV ones here are the ones that say how the file is written, which are the ones where guessing wrong changes the answer rather than the speed. sep is DuckDB’s other name for delim and is a separate row rather than an alias, because the list is also what the candidates on a misspelling are read out of and the binary prints both of them.

Source

pub fn lookup(name: &str) -> Option<Self>

The function of that name, if there is one.

Trait Implementations§

Source§

impl Clone for TableFunction

Source§

fn clone(&self) -> TableFunction

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for TableFunction

Source§

impl Debug for TableFunction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for TableFunction

Source§

impl PartialEq for TableFunction

Source§

fn eq(&self, other: &TableFunction) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TableFunction

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.