#[non_exhaustive]pub enum Dialect {
Snowflake,
Databricks,
}Expand description
The SQL dialect a lex/parse/format request targets.
#[non_exhaustive] so further dialects can be added without it being a breaking change. Default
is Dialect::Snowflake.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Snowflake
Snowflake SQL — the original and default dialect of this toolchain.
Databricks
Databricks SQL / Spark SQL. Behavior is being filled in across later phases; today its predicate answers describe the intended divergence but no Databricks-specific lexing, parsing, or formatting is wired up yet.
Implementations§
Source§impl Dialect
impl Dialect
Sourcepub fn supports_dollar_quoting(self) -> bool
pub fn supports_dollar_quoting(self) -> bool
Dollar quoting: $$ ... $$ dollar-quoted bodies and $1 / $name positional/variable
references. Snowflake only — Databricks has no $$ body or $n reference.
Sourcepub fn supports_flow_operator(self) -> bool
pub fn supports_flow_operator(self) -> bool
The flow operator ->> chaining statements into a pipeline. Snowflake only.
Sourcepub fn supports_copy_into(self) -> bool
pub fn supports_copy_into(self) -> bool
COPY INTO <target> FROM <source> bulk load/unload. Snowflake only.
Sourcepub fn supports_double_slash_comments(self) -> bool
pub fn supports_double_slash_comments(self) -> bool
// ... line comments. Snowflake accepts them; Databricks/Spark uses / as an operator
and must not have a doubled slash consume the rest of the physical line.
Sourcepub fn supports_semantic_view(self) -> bool
pub fn supports_semantic_view(self) -> bool
CREATE SEMANTIC VIEW ... semantic-layer DDL. Snowflake only.
Sourcepub fn supports_scripting_blocks(self) -> bool
pub fn supports_scripting_blocks(self) -> bool
SQL scripting blocks: BEGIN ... END, declarations, control-flow statements, and the :=
assignment operator. Snowflake and Databricks both support compound SQL blocks.
Sourcepub fn supports_stage_refs(self) -> bool
pub fn supports_stage_refs(self) -> bool
Stage references: @stage / @~ / @%table paths in FROM, COPY, and PUT/GET.
Snowflake only.
Sourcepub fn supports_backtick_identifiers(self) -> bool
pub fn supports_backtick_identifiers(self) -> bool
Backtick-quoted identifiers: `col`. Databricks only (Snowflake quotes with ").
Sourcepub fn supports_prefixed_strings(self) -> bool
pub fn supports_prefixed_strings(self) -> bool
Databricks/Spark prefixed string literals such as raw strings (r'...') and hex binary
literals (X'1A').
Sourcepub fn supports_null_safe_eq(self) -> bool
pub fn supports_null_safe_eq(self) -> bool
Databricks/Spark null-safe equality operator: <=>.
Sourcepub fn supports_lateral_view(self) -> bool
pub fn supports_lateral_view(self) -> bool
LATERAL VIEW explode(...) table-generating clause. Databricks only.
Sourcepub fn supports_delta_table_options(self) -> bool
pub fn supports_delta_table_options(self) -> bool
Delta/Spark table DDL options: USING, LOCATION, TBLPROPERTIES, OPTIONS, and
PARTITIONED BY. Databricks only.
Sourcepub fn supports_lambda_expr(self) -> bool
pub fn supports_lambda_expr(self) -> bool
Higher-order-function lambdas: x -> expr and (x, y) -> expr. Databricks only for now.
Sourcepub fn supports_as_of_travel(self) -> bool
pub fn supports_as_of_travel(self) -> bool
Time travel via VERSION AS OF / TIMESTAMP AS OF. Databricks only (Snowflake uses
AT / BEFORE).
Sourcepub fn supports_databricks_query_clauses(self) -> bool
pub fn supports_databricks_query_clauses(self) -> bool
Databricks/Spark query distribution clauses: DISTRIBUTE BY, SORT BY, and CLUSTER BY.
Sourcepub fn supports_delta_commands(self) -> bool
pub fn supports_delta_commands(self) -> bool
Delta/Spark maintenance + cache statements — VACUUM, OPTIMIZE … ZORDER BY,
INSERT OVERWRITE, CACHE/UNCACHE/REFRESH, DESCRIBE HISTORY, and the
WHEN NOT MATCHED BY SOURCE/INSERT * MERGE extensions. Databricks only. The leading words
(VACUUM, OPTIMIZE, CACHE, …) are recognized contextually at statement start, so they
stay ordinary identifiers under Snowflake (and elsewhere under Databricks), and Snowflake
output is byte-identical.