CustomDialectBuilder

Struct CustomDialectBuilder 

Source
pub struct CustomDialectBuilder {
Show 20 fields identifier_quote_style: Option<char>, supports_nulls_first_in_sort: bool, use_timestamp_for_date64: bool, interval_style: IntervalStyle, float64_ast_dtype: DataType, utf8_cast_dtype: DataType, large_utf8_cast_dtype: DataType, date_field_extract_style: DateFieldExtractStyle, character_length_style: CharacterLengthStyle, int64_cast_dtype: DataType, int32_cast_dtype: DataType, timestamp_cast_dtype: DataType, timestamp_tz_cast_dtype: DataType, date32_cast_dtype: DataType, supports_column_alias_in_table_alias: bool, requires_derived_table_alias: bool, division_operator: BinaryOperator, window_func_support_window_frame: bool, full_qualified_col: bool, unnest_as_table_factor: bool,
}
Expand description

CustomDialectBuilder to build CustomDialect using builder pattern

§Examples

Building a custom dialect with all default options set in CustomDialectBuilder::new() but with use_timestamp_for_date64 overridden to true

use datafusion_sql::unparser::dialect::CustomDialectBuilder;
let dialect = CustomDialectBuilder::new()
    .with_use_timestamp_for_date64(true)
    .build();

Fields§

§identifier_quote_style: Option<char>§supports_nulls_first_in_sort: bool§use_timestamp_for_date64: bool§interval_style: IntervalStyle§float64_ast_dtype: DataType§utf8_cast_dtype: DataType§large_utf8_cast_dtype: DataType§date_field_extract_style: DateFieldExtractStyle§character_length_style: CharacterLengthStyle§int64_cast_dtype: DataType§int32_cast_dtype: DataType§timestamp_cast_dtype: DataType§timestamp_tz_cast_dtype: DataType§date32_cast_dtype: DataType§supports_column_alias_in_table_alias: bool§requires_derived_table_alias: bool§division_operator: BinaryOperator§window_func_support_window_frame: bool§full_qualified_col: bool§unnest_as_table_factor: bool

Implementations§

Source§

impl CustomDialectBuilder

Source

pub fn new() -> Self

Source

pub fn build(self) -> CustomDialect

Source

pub fn with_identifier_quote_style(self, identifier_quote_style: char) -> Self

Customize the dialect with a specific identifier quote style, e.g. ‘`’, ‘“’

Source

pub fn with_supports_nulls_first_in_sort( self, supports_nulls_first_in_sort: bool, ) -> Self

Customize the dialect to support NULLS FIRST in ORDER BY clauses

Source

pub fn with_use_timestamp_for_date64( self, use_timestamp_for_date64: bool, ) -> Self

Customize the dialect to uses TIMESTAMP when casting Date64 rather than DATETIME

Source

pub fn with_interval_style(self, interval_style: IntervalStyle) -> Self

Customize the dialect with a specific interval style listed in IntervalStyle

Source

pub fn with_character_length_style( self, character_length_style: CharacterLengthStyle, ) -> Self

Customize the dialect with a specific character_length_style listed in CharacterLengthStyle

Source

pub fn with_float64_ast_dtype(self, float64_ast_dtype: DataType) -> Self

Customize the dialect with a specific SQL type for Float64 casting: DOUBLE, DOUBLE PRECISION, etc.

Source

pub fn with_utf8_cast_dtype(self, utf8_cast_dtype: DataType) -> Self

Customize the dialect with a specific SQL type for Utf8 casting: VARCHAR, CHAR, etc.

Source

pub fn with_large_utf8_cast_dtype(self, large_utf8_cast_dtype: DataType) -> Self

Customize the dialect with a specific SQL type for LargeUtf8 casting: TEXT, CHAR, etc.

Source

pub fn with_date_field_extract_style( self, date_field_extract_style: DateFieldExtractStyle, ) -> Self

Customize the dialect with a specific date field extract style listed in DateFieldExtractStyle

Source

pub fn with_int64_cast_dtype(self, int64_cast_dtype: DataType) -> Self

Customize the dialect with a specific SQL type for Int64 casting: BigInt, SIGNED, etc.

Source

pub fn with_int32_cast_dtype(self, int32_cast_dtype: DataType) -> Self

Customize the dialect with a specific SQL type for Int32 casting: Integer, SIGNED, etc.

Source

pub fn with_timestamp_cast_dtype( self, timestamp_cast_dtype: DataType, timestamp_tz_cast_dtype: DataType, ) -> Self

Customize the dialect with a specific SQL type for Timestamp casting: Timestamp, Datetime, etc.

Source

pub fn with_date32_cast_dtype(self, date32_cast_dtype: DataType) -> Self

Source

pub fn with_supports_column_alias_in_table_alias( self, supports_column_alias_in_table_alias: bool, ) -> Self

Customize the dialect to support column aliases as part of alias table definition

Source

pub fn with_requires_derived_table_alias( self, requires_derived_table_alias: bool, ) -> Self

Source

pub fn with_division_operator(self, division_operator: BinaryOperator) -> Self

Source

pub fn with_window_func_support_window_frame( self, window_func_support_window_frame: bool, ) -> Self

Source

pub fn with_full_qualified_col(self, full_qualified_col: bool) -> Self

Customize the dialect to allow full qualified column names

Source

pub fn with_unnest_as_table_factor(self, unnest_as_table_factor: bool) -> Self

Trait Implementations§

Source§

impl Default for CustomDialectBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

§

impl<T> ErasedDestructor for T
where T: 'static,