diff --git a/src/ast/operator.rs b/src/ast/operator.rs index 58c401f7d5..fecf40fafe 100644 --- a/src/ast/operator.rs +++ b/src/ast/operator.rs @@ -36,7 +36,7 @@ pub enum UnaryOperator { /// `@-@` Length or circumference (PostgreSQL/Redshift geometric operator) /// see AtDashAt, - /// Unary logical not operator: e.g. `! false` (Hive-specific) + /// Unary logical not operator: e.g. `!false` BangNot, /// Bitwise Not, e.g. `~9` BitwiseNot, diff --git a/src/dialect/databricks.rs b/src/dialect/databricks.rs index 18ee3e0aaf..b6defd1390 100644 --- a/src/dialect/databricks.rs +++ b/src/dialect/databricks.rs @@ -90,6 +90,11 @@ impl Dialect for DatabricksDialect { true } + /// See + fn supports_bang_not_operator(&self) -> bool { + true + } + /// See fn supports_group_by_with_modifier(&self) -> bool { true diff --git a/tests/sqlparser_databricks.rs b/tests/sqlparser_databricks.rs index 3d2ca9d77f..8bcbd5cdc1 100644 --- a/tests/sqlparser_databricks.rs +++ b/tests/sqlparser_databricks.rs @@ -110,6 +110,13 @@ fn test_databricks_exists() { ); } +#[test] +fn test_databricks_bang_not() { + databricks().verified_expr("!true"); + databricks().verified_expr("!false"); + databricks().verified_expr("!NULL"); +} + #[test] fn test_databricks_lambdas() { #[rustfmt::skip]