Skip to content

Commit 6ae2e8d

Browse files
Merge branch 'main' into scope-expect-panic
2 parents d0ed48e + d526819 commit 6ae2e8d

29 files changed

+845
-57
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
[package]
1919
name = "sqlparser"
2020
description = "Extensible SQL Lexer and Parser with support for ANSI SQL:2011"
21-
version = "0.60.0"
21+
version = "0.61.0"
2222
authors = ["Apache DataFusion <dev@datafusion.apache.org>"]
2323
homepage = "https://github.com/apache/datafusion-sqlparser-rs"
2424
documentation = "https://docs.rs/sqlparser/"
@@ -55,7 +55,7 @@ serde = { version = "1.0", default-features = false, features = ["derive", "allo
5555
# of dev-dependencies because of
5656
# https://github.com/rust-lang/cargo/issues/1596
5757
serde_json = { version = "1.0", optional = true }
58-
sqlparser_derive = { version = "0.4.0", path = "derive", optional = true }
58+
sqlparser_derive = { version = "0.5.0", path = "derive", optional = true }
5959

6060
[dev-dependencies]
6161
simple_logger = "5.0"

changelog/0.61.0.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
-->
19+
20+
# sqlparser-rs 0.61.0 Changelog
21+
22+
This release consists of 66 commits from 22 contributors. See credits at the end of this changelog for more information.
23+
24+
**Performance related:**
25+
26+
- perf: remove unnecessary string clone in maybe_concat_string_literal [#2173](https://github.com/apache/datafusion-sqlparser-rs/pull/2173) (andygrove)
27+
- perf: optimize `make_word()` to avoid unnecessary allocations [#2176](https://github.com/apache/datafusion-sqlparser-rs/pull/2176) (andygrove)
28+
29+
**Fixed bugs:**
30+
31+
- fix: Set the current folder as a "primary" for the `find` command [#2120](https://github.com/apache/datafusion-sqlparser-rs/pull/2120) (martin-g)
32+
- fix: qualified column names with SQL keywords parse as identifiers [#2157](https://github.com/apache/datafusion-sqlparser-rs/pull/2157) (bombsimon)
33+
34+
**Other:**
35+
36+
- Fixing location for extrenal tables [#2108](https://github.com/apache/datafusion-sqlparser-rs/pull/2108) (romanoff)
37+
- Added support for `ALTER OPERATOR` syntax [#2114](https://github.com/apache/datafusion-sqlparser-rs/pull/2114) (LucaCappelletti94)
38+
- Oracle: Support for MERGE predicates [#2101](https://github.com/apache/datafusion-sqlparser-rs/pull/2101) (xitep)
39+
- [Oracle] Lower StringConcat precedence [#2115](https://github.com/apache/datafusion-sqlparser-rs/pull/2115) (xitep)
40+
- Added alter external table support for snowflake [#2122](https://github.com/apache/datafusion-sqlparser-rs/pull/2122) (romanoff)
41+
- MSSQL: Add support for parenthesized stored procedure name in EXEC [#2126](https://github.com/apache/datafusion-sqlparser-rs/pull/2126) (yoavcloud)
42+
- MSSQL: Parse IF/ELSE without semicolon delimiters [#2128](https://github.com/apache/datafusion-sqlparser-rs/pull/2128) (yoavcloud)
43+
- Extract source comments [#2107](https://github.com/apache/datafusion-sqlparser-rs/pull/2107) (xitep)
44+
- PostgreSQL: Support schema-qualified operator classes in CREATE INDEX [#2131](https://github.com/apache/datafusion-sqlparser-rs/pull/2131) (dddenis)
45+
- Oracle: Support for quote delimited strings [#2130](https://github.com/apache/datafusion-sqlparser-rs/pull/2130) (xitep)
46+
- Added support for `ALTER OPERATOR FAMILY` syntax [#2125](https://github.com/apache/datafusion-sqlparser-rs/pull/2125) (LucaCappelletti94)
47+
- PostgreSQL Tokenization: Fix unexpected characters after question mark being silently ignored [#2129](https://github.com/apache/datafusion-sqlparser-rs/pull/2129) (jnlt3)
48+
- Support parsing parenthesized wildcard `(*)` [#2123](https://github.com/apache/datafusion-sqlparser-rs/pull/2123) (romanoff)
49+
- Make benchmark statement valid [#2139](https://github.com/apache/datafusion-sqlparser-rs/pull/2139) (xitep)
50+
- Fix parse_identifiers not taking semicolons into account [#2137](https://github.com/apache/datafusion-sqlparser-rs/pull/2137) (jnlt3)
51+
- Add PostgreSQL PARTITION OF syntax support [#2127](https://github.com/apache/datafusion-sqlparser-rs/pull/2127) (fmguerreiro)
52+
- Databricks: Support Timetravel With "TIMESTAMP AS OF" [#2134](https://github.com/apache/datafusion-sqlparser-rs/pull/2134) (JamesVorder)
53+
- MySQL: Parse bitwise shift left/right operators [#2152](https://github.com/apache/datafusion-sqlparser-rs/pull/2152) (mvzink)
54+
- Redshift: Add support for optional JSON format in copy option [#2141](https://github.com/apache/datafusion-sqlparser-rs/pull/2141) (yoavcloud)
55+
- MySQL: Add missing support for TREE explain format [#2145](https://github.com/apache/datafusion-sqlparser-rs/pull/2145) (yoavcloud)
56+
- MySQL: Add support for && as boolean AND [#2144](https://github.com/apache/datafusion-sqlparser-rs/pull/2144) (yoavcloud)
57+
- PostgreSQL: ALTER USER password option [#2142](https://github.com/apache/datafusion-sqlparser-rs/pull/2142) (yoavcloud)
58+
- Key Value Options: add support for trailing semicolon [#2140](https://github.com/apache/datafusion-sqlparser-rs/pull/2140) (yoavcloud)
59+
- Added support for `ALTER OPERATOR CLASS` syntax [#2135](https://github.com/apache/datafusion-sqlparser-rs/pull/2135) (LucaCappelletti94)
60+
- Added missing `Copy` derives [#2158](https://github.com/apache/datafusion-sqlparser-rs/pull/2158) (LucaCappelletti94)
61+
- Tokenize empty line comments correctly [#2161](https://github.com/apache/datafusion-sqlparser-rs/pull/2161) (zyuiop)
62+
- Add support for DuckDB `LAMBDA` keyword syntax [#2149](https://github.com/apache/datafusion-sqlparser-rs/pull/2149) (lovasoa)
63+
- MySQL: Add support for casting using the BINARY keyword [#2146](https://github.com/apache/datafusion-sqlparser-rs/pull/2146) (yoavcloud)
64+
- Added missing `From` impls for `Statement` variants [#2160](https://github.com/apache/datafusion-sqlparser-rs/pull/2160) (LucaCappelletti94)
65+
- GenericDialect: support colon operator for JsonAccess [#2124](https://github.com/apache/datafusion-sqlparser-rs/pull/2124) (Samyak2)
66+
- Databricks: Support Timetravel With "VERSION AS OF" [#2155](https://github.com/apache/datafusion-sqlparser-rs/pull/2155) (JamesVorder)
67+
- Fixed truncate table if exists for snowflake [#2166](https://github.com/apache/datafusion-sqlparser-rs/pull/2166) (romanoff)
68+
- Refactor: replace some `dialect_of!` checks with `Dialect` trait methods [#2171](https://github.com/apache/datafusion-sqlparser-rs/pull/2171) (andygrove)
69+
- MySQL: Support `CAST(... AS ... ARRAY)` syntax [#2151](https://github.com/apache/datafusion-sqlparser-rs/pull/2151) (mvzink)
70+
- Snowflake: Support SAMPLE clause on subqueries [#2164](https://github.com/apache/datafusion-sqlparser-rs/pull/2164) (finchxxia)
71+
- refactor: use `to_ident()` instead of `clone().into_ident()` for borrowed Words [#2177](https://github.com/apache/datafusion-sqlparser-rs/pull/2177) (andygrove)
72+
- Refactor: replace more `dialect_of!` checks with `Dialect` trait methods [#2175](https://github.com/apache/datafusion-sqlparser-rs/pull/2175) (andygrove)
73+
- minor: reduce unnecessary string allocations [#2178](https://github.com/apache/datafusion-sqlparser-rs/pull/2178) (andygrove)
74+
- PostgreSQL: Support force row level security [#2169](https://github.com/apache/datafusion-sqlparser-rs/pull/2169) (isaacparker0)
75+
- PostgreSQL: Add support for `*` (descendant) option in TRUNCATE [#2181](https://github.com/apache/datafusion-sqlparser-rs/pull/2181) (mvzink)
76+
- Fix identifier parsing not breaking on the `|>` pipe operator [#2156](https://github.com/apache/datafusion-sqlparser-rs/pull/2156) (alexander-beedie)
77+
- [MySQL, Oracle] Parse optimizer hints [#2162](https://github.com/apache/datafusion-sqlparser-rs/pull/2162) (xitep)
78+
- Redshift: Support implicit string concatenation using newline [#2167](https://github.com/apache/datafusion-sqlparser-rs/pull/2167) (yoavcloud)
79+
- PostgreSQL: Fix REPLICA IDENTITY to use NOTHING [#2179](https://github.com/apache/datafusion-sqlparser-rs/pull/2179) (mvzink)
80+
- Add ENFORCED/NOT ENFORCED support for column-level CHECK constraints [#2180](https://github.com/apache/datafusion-sqlparser-rs/pull/2180) (mvzink)
81+
- Implement `core::error::Error` for `ParserError` and `TokenizerError` [#2189](https://github.com/apache/datafusion-sqlparser-rs/pull/2189) (LucaCappelletti94)
82+
- Moved more structs outside of Statement to facilitate reuse [#2188](https://github.com/apache/datafusion-sqlparser-rs/pull/2188) (LucaCappelletti94)
83+
- Fix parsing cast operator after parenthesized `DEFAULT` expression [#2168](https://github.com/apache/datafusion-sqlparser-rs/pull/2168) (isaacparker0)
84+
- Streamlined derivation of new `Dialect` objects [#2174](https://github.com/apache/datafusion-sqlparser-rs/pull/2174) (alexander-beedie)
85+
- MSSQL: Support standalone BEGIN...END blocks [#2186](https://github.com/apache/datafusion-sqlparser-rs/pull/2186) (guan404ming)
86+
- MySQL: Add support for `SELECT` modifiers [#2172](https://github.com/apache/datafusion-sqlparser-rs/pull/2172) (mvzink)
87+
- MySQL: Add support for DEFAULT CHARACTER SET in CREATE DATABASE [#2182](https://github.com/apache/datafusion-sqlparser-rs/pull/2182) (mvzink)
88+
- [Oracle] Support hierarchical queries [#2185](https://github.com/apache/datafusion-sqlparser-rs/pull/2185) (xitep)
89+
- MySQL: Allow optional constraint name after CONSTRAINT keyword [#2183](https://github.com/apache/datafusion-sqlparser-rs/pull/2183) (mvzink)
90+
- Added missing derives to dialect marker structs [#2191](https://github.com/apache/datafusion-sqlparser-rs/pull/2191) (LucaCappelletti94)
91+
- Fixed overflow error, recursion counter was not included for parenthesis [#2199](https://github.com/apache/datafusion-sqlparser-rs/pull/2199) (LucaCappelletti94)
92+
- Add support for C-style comments [#2034](https://github.com/apache/datafusion-sqlparser-rs/pull/2034) (altmannmarcelo)
93+
- PostgreSQL: Support PostgreSQL ANALYZE with optional table and column [#2187](https://github.com/apache/datafusion-sqlparser-rs/pull/2187) (guan404ming)
94+
- Add Tokenizer custom token mapper support [#2184](https://github.com/apache/datafusion-sqlparser-rs/pull/2184) (askalt)
95+
- Fix MAP literals parsing [#2205](https://github.com/apache/datafusion-sqlparser-rs/pull/2205) (Samyak2)
96+
97+
## Credits
98+
99+
Thank you to everyone who contributed to this release. Here is a breakdown of commits (PRs merged) per contributor.
100+
101+
```
102+
9 Luca Cappelletti
103+
9 Yoav Cohen
104+
8 Michael Victor Zink
105+
7 xitep
106+
6 Andy Grove
107+
4 Andriy Romanov
108+
2 Alexander Beedie
109+
2 Andrew Lamb
110+
2 Guan-Ming (Wesley) Chiu
111+
2 James Vorderbruggen
112+
2 Samyak Sarnayak
113+
2 isaacparker0
114+
2 jnlt3
115+
1 Albert Skalt
116+
1 Denis Goncharenko
117+
1 Filipe Guerreiro
118+
1 Louis Vialar
119+
1 Marcelo Altmann
120+
1 Martin Grigorov
121+
1 Ophir LOJKINE
122+
1 Simon Sawert
123+
1 finchxxia
124+
```
125+
126+
Thank you also to everyone who contributed in other ways such as filing issues, reviewing PRs, and providing feedback on this release.
127+

derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
[package]
1919
name = "sqlparser_derive"
2020
description = "Procedural (proc) macros for sqlparser"
21-
version = "0.4.0"
21+
version = "0.5.0"
2222
authors = ["sqlparser-rs authors"]
2323
homepage = "https://github.com/sqlparser-rs/sqlparser-rs"
2424
documentation = "https://docs.rs/sqlparser_derive/"

dev/release/release-tarball.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ fi
4343
version=$1
4444
rc=$2
4545

46+
read -r -p "Proceed to release tarball for ${version}-rc${rc}? [y/N]: " answer
47+
answer=${answer:-no}
48+
if [ "${answer}" != "y" ]; then
49+
echo "Cancelled tarball release!"
50+
exit 1
51+
fi
52+
4653
tmp_dir=tmp-apache-datafusion-dist
4754

4855
echo "Recreate temporary directory: ${tmp_dir}"

src/ast/mod.rs

Lines changed: 52 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3326,19 +3326,24 @@ impl Display for ExceptionWhen {
33263326
}
33273327
}
33283328

3329-
/// ANALYZE TABLE statement (Hive-specific)
3329+
/// ANALYZE statement
3330+
///
3331+
/// Supported syntax varies by dialect:
3332+
/// - Hive: `ANALYZE TABLE t [PARTITION (...)] COMPUTE STATISTICS [NOSCAN] [FOR COLUMNS [col1, ...]] [CACHE METADATA]`
3333+
/// - PostgreSQL: `ANALYZE [VERBOSE] [t [(col1, ...)]]` See <https://www.postgresql.org/docs/current/sql-analyze.html>
3334+
/// - General: `ANALYZE [TABLE] t`
33303335
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
33313336
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33323337
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
33333338
pub struct Analyze {
33343339
#[cfg_attr(feature = "visitor", visit(with = "visit_relation"))]
3335-
/// Name of the table to analyze.
3336-
pub table_name: ObjectName,
3340+
/// Name of the table to analyze. `None` for bare `ANALYZE`.
3341+
pub table_name: Option<ObjectName>,
33373342
/// Optional partition expressions to restrict the analysis.
33383343
pub partitions: Option<Vec<Expr>>,
3339-
/// `true` when analyzing specific columns.
3344+
/// `true` when analyzing specific columns (Hive `FOR COLUMNS` syntax).
33403345
pub for_columns: bool,
3341-
/// Columns to analyze when `for_columns` is `true`.
3346+
/// Columns to analyze.
33423347
pub columns: Vec<Ident>,
33433348
/// Whether to cache metadata before analyzing.
33443349
pub cache_metadata: bool,
@@ -3352,22 +3357,21 @@ pub struct Analyze {
33523357

33533358
impl fmt::Display for Analyze {
33543359
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3355-
write!(
3356-
f,
3357-
"ANALYZE{}{table_name}",
3360+
write!(f, "ANALYZE")?;
3361+
if let Some(ref table_name) = self.table_name {
33583362
if self.has_table_keyword {
3359-
" TABLE "
3360-
} else {
3361-
" "
3362-
},
3363-
table_name = self.table_name
3364-
)?;
3363+
write!(f, " TABLE")?;
3364+
}
3365+
write!(f, " {table_name}")?;
3366+
}
3367+
if !self.for_columns && !self.columns.is_empty() {
3368+
write!(f, " ({})", display_comma_separated(&self.columns))?;
3369+
}
33653370
if let Some(ref parts) = self.partitions {
33663371
if !parts.is_empty() {
33673372
write!(f, " PARTITION ({})", display_comma_separated(parts))?;
33683373
}
33693374
}
3370-
33713375
if self.compute_statistics {
33723376
write!(f, " COMPUTE STATISTICS")?;
33733377
}
@@ -4574,22 +4578,40 @@ pub enum Statement {
45744578
/// Legacy copy-style options.
45754579
options: Vec<CopyLegacyOption>,
45764580
},
4581+
/// ClickHouse:
45774582
/// ```sql
45784583
/// OPTIMIZE TABLE [db.]name [ON CLUSTER cluster] [PARTITION partition | PARTITION ID 'partition_id'] [FINAL] [DEDUPLICATE [BY expression]]
45794584
/// ```
4580-
///
45814585
/// See ClickHouse <https://clickhouse.com/docs/en/sql-reference/statements/optimize>
4586+
///
4587+
/// Databricks:
4588+
/// ```sql
4589+
/// OPTIMIZE table_name [WHERE predicate] [ZORDER BY (col_name1 [, ...])]
4590+
/// ```
4591+
/// See Databricks <https://docs.databricks.com/en/sql/language-manual/delta-optimize.html>
45824592
OptimizeTable {
45834593
/// Table name to optimize.
45844594
name: ObjectName,
4595+
/// Whether the `TABLE` keyword was present (ClickHouse uses `OPTIMIZE TABLE`, Databricks uses `OPTIMIZE`).
4596+
has_table_keyword: bool,
45854597
/// Optional cluster identifier.
4598+
/// [ClickHouse](https://clickhouse.com/docs/en/sql-reference/statements/optimize)
45864599
on_cluster: Option<Ident>,
45874600
/// Optional partition spec.
4601+
/// [ClickHouse](https://clickhouse.com/docs/en/sql-reference/statements/optimize)
45884602
partition: Option<Partition>,
45894603
/// Whether `FINAL` was specified.
4604+
/// [ClickHouse](https://clickhouse.com/docs/en/sql-reference/statements/optimize)
45904605
include_final: bool,
45914606
/// Optional deduplication settings.
4607+
/// [ClickHouse](https://clickhouse.com/docs/en/sql-reference/statements/optimize)
45924608
deduplicate: Option<Deduplicate>,
4609+
/// Optional WHERE predicate.
4610+
/// [Databricks](https://docs.databricks.com/en/sql/language-manual/delta-optimize.html)
4611+
predicate: Option<Expr>,
4612+
/// Optional ZORDER BY columns.
4613+
/// [Databricks](https://docs.databricks.com/en/sql/language-manual/delta-optimize.html)
4614+
zorder: Option<Vec<Expr>>,
45934615
},
45944616
/// ```sql
45954617
/// LISTEN
@@ -6065,12 +6087,19 @@ impl fmt::Display for Statement {
60656087
}
60666088
Statement::OptimizeTable {
60676089
name,
6090+
has_table_keyword,
60686091
on_cluster,
60696092
partition,
60706093
include_final,
60716094
deduplicate,
6095+
predicate,
6096+
zorder,
60726097
} => {
6073-
write!(f, "OPTIMIZE TABLE {name}")?;
6098+
write!(f, "OPTIMIZE")?;
6099+
if *has_table_keyword {
6100+
write!(f, " TABLE")?;
6101+
}
6102+
write!(f, " {name}")?;
60746103
if let Some(on_cluster) = on_cluster {
60756104
write!(f, " ON CLUSTER {on_cluster}")?;
60766105
}
@@ -6083,6 +6112,12 @@ impl fmt::Display for Statement {
60836112
if let Some(deduplicate) = deduplicate {
60846113
write!(f, " {deduplicate}")?;
60856114
}
6115+
if let Some(predicate) = predicate {
6116+
write!(f, " WHERE {predicate}")?;
6117+
}
6118+
if let Some(zorder) = zorder {
6119+
write!(f, " ZORDER BY ({})", display_comma_separated(zorder))?;
6120+
}
60866121
Ok(())
60876122
}
60886123
Statement::LISTEN { channel } => {

src/ast/spans.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,9 @@ impl Spanned for ConstraintCharacteristics {
841841
impl Spanned for Analyze {
842842
fn span(&self) -> Span {
843843
union_spans(
844-
core::iter::once(self.table_name.span())
844+
self.table_name
845+
.iter()
846+
.map(|t| t.span())
845847
.chain(
846848
self.partitions
847849
.iter()

src/dialect/ansi.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
use crate::dialect::Dialect;
1919

2020
/// A [`Dialect`] for [ANSI SQL](https://en.wikipedia.org/wiki/SQL:2011).
21-
#[derive(Debug, Default)]
21+
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
22+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2223
pub struct AnsiDialect {}
2324

2425
impl Dialect for AnsiDialect {

src/dialect/bigquery.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ const RESERVED_FOR_COLUMN_ALIAS: &[Keyword] = &[
4242
];
4343

4444
/// A [`Dialect`] for [Google Bigquery](https://cloud.google.com/bigquery/)
45-
#[derive(Debug, Default)]
45+
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
46+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4647
pub struct BigQueryDialect;
4748

4849
impl Dialect for BigQueryDialect {

src/dialect/clickhouse.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
use crate::dialect::Dialect;
1919

2020
/// A [`Dialect`] for [ClickHouse](https://clickhouse.com/).
21-
#[derive(Debug, Default)]
21+
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
22+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2223
pub struct ClickHouseDialect {}
2324

2425
impl Dialect for ClickHouseDialect {

src/dialect/databricks.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ use crate::dialect::Dialect;
2020
/// A [`Dialect`] for [Databricks SQL](https://www.databricks.com/)
2121
///
2222
/// See <https://docs.databricks.com/en/sql/language-manual/index.html>.
23-
#[derive(Debug, Default)]
23+
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
24+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2425
pub struct DatabricksDialect;
2526

2627
impl Dialect for DatabricksDialect {
@@ -84,4 +85,9 @@ impl Dialect for DatabricksDialect {
8485
fn supports_values_as_table_factor(&self) -> bool {
8586
true
8687
}
88+
89+
/// See <https://docs.databricks.com/en/sql/language-manual/delta-optimize.html>
90+
fn supports_optimize_table(&self) -> bool {
91+
true
92+
}
8793
}

0 commit comments

Comments
 (0)