From c6f9879efa1c4921fd1f170f75640d95daccbd7b Mon Sep 17 00:00:00 2001 From: Ben King <9087625+benfdking@users.noreply.github.com> Date: Thu, 19 Dec 2024 11:32:47 +0100 Subject: [PATCH] temp [ci skip] --- crates/lib-core/src/dialects/base.rs | 1 + crates/lib-dialects/src/databricks.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/lib-core/src/dialects/base.rs b/crates/lib-core/src/dialects/base.rs index 8fad02c1..d265e211 100644 --- a/crates/lib-core/src/dialects/base.rs +++ b/crates/lib-core/src/dialects/base.rs @@ -69,6 +69,7 @@ impl Dialect { .unwrap_or_else(|| panic!("Failed to get mutable reference for {name}")) { DialectElementType::Matchable(matchable) => { + println!("Replacing grammar {:?} with new grammar.", matchable); matchable.as_node_matcher().unwrap().match_grammar = match_grammar; } DialectElementType::SegmentGenerator(_) => { diff --git a/crates/lib-dialects/src/databricks.rs b/crates/lib-dialects/src/databricks.rs index 12392c85..88ba0fc7 100644 --- a/crates/lib-dialects/src/databricks.rs +++ b/crates/lib-dialects/src/databricks.rs @@ -259,7 +259,7 @@ pub fn dialect() -> Dialect { // Only difference between this and the SparkSQL version: // - `LIKE` keyword is optional databricks.replace_grammar( - "ShowViewsGrammar".into(), + "ShowViewsStatement".into(), Sequence::new(vec_of_erased![ Ref::keyword("VIEWS"), Sequence::new(vec_of_erased![one_of(vec_of_erased![ @@ -278,6 +278,7 @@ pub fn dialect() -> Dialect { .to_matchable() .into(), ); + // TODO Missing Show Object Grammar databricks.replace_grammar( "NotNullGrammar".into(),