Skip to main content

PrestoDialect

Struct PrestoDialect 

Source
pub struct PrestoDialect;
Expand description

Presto dialect

Implementations§

Source§

impl PrestoDialect

Source

pub fn oracle_to_presto_format(fmt: &str) -> String

Convert Oracle/PostgreSQL-style date format to Presto’s C-style format Oracle: dd, hh, hh24, mi, mm, ss, yyyy, yy Presto: %d, %H, %H, %i, %m, %s, %Y, %y

Source

pub fn presto_to_java_format(fmt: &str) -> String

Convert Presto’s C-style date format to Java-style format (for Hive/Spark) Presto: %Y, %m, %d, %H, %i, %S, %s, %y, %T, %F Java: yyyy, MM, dd, HH, mm, ss, ss, yy, HH:mm:ss, yyyy-MM-dd

Source

pub fn normalize_presto_format(fmt: &str) -> String

Normalize Presto format strings (e.g., %H:%i:%S -> %T, %Y-%m-%d -> %F)

Source

pub fn presto_to_duckdb_format(fmt: &str) -> String

Convert Presto’s C-style format to DuckDB C-style (only difference: %i -> %M for minutes)

Source

pub fn presto_to_bigquery_format(fmt: &str) -> String

Convert Presto’s C-style format to BigQuery format

Source

pub fn is_default_timestamp_format(fmt: &str) -> bool

Check if a Presto format string matches the default timestamp format

Source

pub fn is_default_date_format(fmt: &str) -> bool

Check if a Presto format string matches the default date format

Trait Implementations§

Source§

impl DialectImpl for PrestoDialect

Source§

fn dialect_type(&self) -> DialectType

Returns the DialectType that identifies this dialect.
Source§

fn tokenizer_config(&self) -> TokenizerConfig

Returns the tokenizer configuration for this dialect. Read more
Source§

fn generator_config(&self) -> GeneratorConfig

Returns the generator configuration for this dialect. Read more
Source§

fn transform_expr(&self, expr: Expression) -> Result<Expression>

Transforms a single expression node for this dialect, without recursing into children. Read more
Source§

fn generator_config_for_expr(&self, _expr: &Expression) -> GeneratorConfig

Returns a generator configuration tailored to a specific expression. Read more
Source§

fn preprocess(&self, expr: Expression) -> Result<Expression>

Applies whole-tree preprocessing transforms before the recursive per-node pass. 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.

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