From f4e3589f82ceb2f9dbf0cc2793d257fcaab90685 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 26 Feb 2025 16:25:36 -0500 Subject: [PATCH 1/9] Update version --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 9caff2512..99bfdc241 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ [package] name = "sqlparser" description = "Extensible SQL Lexer and Parser with support for ANSI SQL:2011" -version = "0.54.0" +version = "0.55.0" authors = ["Apache DataFusion "] homepage = "https://github.com/apache/datafusion-sqlparser-rs" documentation = "https://docs.rs/sqlparser/" From caab84046ec052cabc513bdf8024d432e9af959c Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 26 Feb 2025 16:38:17 -0500 Subject: [PATCH 2/9] Add changelog --- changelog/0.55.0.md | 119 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 changelog/0.55.0.md diff --git a/changelog/0.55.0.md b/changelog/0.55.0.md new file mode 100644 index 000000000..02a30ff15 --- /dev/null +++ b/changelog/0.55.0.md @@ -0,0 +1,119 @@ + + +# sqlparser-rs 0.55.0 Changelog + +This release consists of 54 commits from 25 contributors. See credits at the end of this changelog for more information. + +**Implemented enhancements:** + +- feat: adjust create and drop trigger for mysql dialect [#1734](https://github.com/apache/datafusion-sqlparser-rs/pull/1734) (invm) + +**Fixed bugs:** + +- fix: make `serde` feature no_std [#1730](https://github.com/apache/datafusion-sqlparser-rs/pull/1730) (iajoiner) + +**Other:** + +- Update rat_exclude_file.txt [#1670](https://github.com/apache/datafusion-sqlparser-rs/pull/1670) (alamb) +- Add support for Snowflake account privileges [#1666](https://github.com/apache/datafusion-sqlparser-rs/pull/1666) (yoavcloud) +- Add support for Create Iceberg Table statement for Snowflake parser [#1664](https://github.com/apache/datafusion-sqlparser-rs/pull/1664) (Vedin) +- National strings: check if dialect supports backslash escape [#1672](https://github.com/apache/datafusion-sqlparser-rs/pull/1672) (hansott) +- Only support escape literals for Postgres, Redshift and generic dialect [#1674](https://github.com/apache/datafusion-sqlparser-rs/pull/1674) (hansott) +- BigQuery: Support trailing commas in column definitions list [#1682](https://github.com/apache/datafusion-sqlparser-rs/pull/1682) (iffyio) +- Enhance object name path segments [#1539](https://github.com/apache/datafusion-sqlparser-rs/pull/1539) (ayman-sigma) +- Enable GROUP BY exp for Snowflake dialect [#1683](https://github.com/apache/datafusion-sqlparser-rs/pull/1683) (yoavcloud) +- Add support for parsing empty dictionary expressions [#1684](https://github.com/apache/datafusion-sqlparser-rs/pull/1684) (yoavcloud) +- Support multiple tables in `UPDATE FROM` clause [#1681](https://github.com/apache/datafusion-sqlparser-rs/pull/1681) (iffyio) +- Add support for mysql table hints [#1675](https://github.com/apache/datafusion-sqlparser-rs/pull/1675) (AvivDavid-Satori) +- BigQuery: Add support for select expr star [#1680](https://github.com/apache/datafusion-sqlparser-rs/pull/1680) (iffyio) +- Support underscore separators in numbers for Clickhouse. Fixes #1659 [#1677](https://github.com/apache/datafusion-sqlparser-rs/pull/1677) (graup) +- BigQuery: Fix column identifier reserved keywords list [#1678](https://github.com/apache/datafusion-sqlparser-rs/pull/1678) (iffyio) +- Fix bug when parsing a Snowflake stage with `;` suffix [#1688](https://github.com/apache/datafusion-sqlparser-rs/pull/1688) (yoavcloud) +- Allow plain JOIN without turning it into INNER [#1692](https://github.com/apache/datafusion-sqlparser-rs/pull/1692) (mvzink) +- Fix DDL generation in case of an empty arguments function. [#1690](https://github.com/apache/datafusion-sqlparser-rs/pull/1690) (remysaissy) +- Fix `CREATE FUNCTION` round trip for Hive dialect [#1693](https://github.com/apache/datafusion-sqlparser-rs/pull/1693) (iffyio) +- Make numeric literal underscore test dialect agnostic [#1685](https://github.com/apache/datafusion-sqlparser-rs/pull/1685) (iffyio) +- Extend lambda support for ClickHouse and DuckDB dialects [#1686](https://github.com/apache/datafusion-sqlparser-rs/pull/1686) (gstvg) +- Make TypedString preserve quote style [#1679](https://github.com/apache/datafusion-sqlparser-rs/pull/1679) (graup) +- Do not parse ASOF and MATCH_CONDITION as table factor aliases [#1698](https://github.com/apache/datafusion-sqlparser-rs/pull/1698) (yoavcloud) +- Add support for GRANT on some common Snowflake objects [#1699](https://github.com/apache/datafusion-sqlparser-rs/pull/1699) (yoavcloud) +- Add RETURNS TABLE() support for CREATE FUNCTION in Postgresql [#1687](https://github.com/apache/datafusion-sqlparser-rs/pull/1687) (remysaissy) +- Add parsing for GRANT ROLE and GRANT DATABASE ROLE in Snowflake dialect [#1689](https://github.com/apache/datafusion-sqlparser-rs/pull/1689) (yoavcloud) +- Add support for `CREATE/ALTER/DROP CONNECTOR` syntax [#1701](https://github.com/apache/datafusion-sqlparser-rs/pull/1701) (wugeer) +- Parse Snowflake COPY INTO [#1669](https://github.com/apache/datafusion-sqlparser-rs/pull/1669) (yoavcloud) +- Require space after -- to start single line comment in MySQL [#1705](https://github.com/apache/datafusion-sqlparser-rs/pull/1705) (hansott) +- Add suppport for Show Objects statement for the Snowflake parser [#1702](https://github.com/apache/datafusion-sqlparser-rs/pull/1702) (DanCodedThis) +- Fix incorrect parsing of JsonAccess bracket notation after cast in Snowflake [#1708](https://github.com/apache/datafusion-sqlparser-rs/pull/1708) (yoavcloud) +- Parse Postgres VARBIT datatype [#1703](https://github.com/apache/datafusion-sqlparser-rs/pull/1703) (mvzink) +- Implement FROM-first selects [#1713](https://github.com/apache/datafusion-sqlparser-rs/pull/1713) (mitsuhiko) +- Enable custom dialects to support `MATCH() AGAINST()` [#1719](https://github.com/apache/datafusion-sqlparser-rs/pull/1719) (joocer) +- Support group by cube/rollup etc in BigQuery [#1720](https://github.com/apache/datafusion-sqlparser-rs/pull/1720) (Groennbeck) +- Add support for MS Varbinary(MAX) (#1714) [#1715](https://github.com/apache/datafusion-sqlparser-rs/pull/1715) (TylerBrinks) +- Add supports for Hive's `SELECT ... GROUP BY .. GROUPING SETS` syntax [#1653](https://github.com/apache/datafusion-sqlparser-rs/pull/1653) (wugeer) +- Differentiate LEFT JOIN from LEFT OUTER JOIN [#1726](https://github.com/apache/datafusion-sqlparser-rs/pull/1726) (mvzink) +- Add support for Postgres `ALTER TYPE` [#1727](https://github.com/apache/datafusion-sqlparser-rs/pull/1727) (jvatic) +- Replace `Method` and `CompositeAccess` with `CompoundFieldAccess` [#1716](https://github.com/apache/datafusion-sqlparser-rs/pull/1716) (iffyio) +- Add support for `EXECUTE IMMEDIATE` [#1717](https://github.com/apache/datafusion-sqlparser-rs/pull/1717) (iffyio) +- Treat COLLATE like any other column option [#1731](https://github.com/apache/datafusion-sqlparser-rs/pull/1731) (mvzink) +- Add support for PostgreSQL/Redshift geometric operators [#1723](https://github.com/apache/datafusion-sqlparser-rs/pull/1723) (benrsatori) +- Implement SnowFlake ALTER SESSION [#1712](https://github.com/apache/datafusion-sqlparser-rs/pull/1712) (osipovartem) +- Extend Visitor trait for Value type [#1725](https://github.com/apache/datafusion-sqlparser-rs/pull/1725) (tomershaniii) +- Add support for `ORDER BY ALL` [#1724](https://github.com/apache/datafusion-sqlparser-rs/pull/1724) (PokIsemaine) +- Parse casting to array using double colon operator in Redshift [#1737](https://github.com/apache/datafusion-sqlparser-rs/pull/1737) (yoavcloud) +- Replace parallel condition/result vectors with single CaseWhen vector in Expr::Case [#1733](https://github.com/apache/datafusion-sqlparser-rs/pull/1733) (lovasoa) +- BigQuery: Add support for `BEGIN` [#1718](https://github.com/apache/datafusion-sqlparser-rs/pull/1718) (iffyio) +- Store spans for Value expressions [#1738](https://github.com/apache/datafusion-sqlparser-rs/pull/1738) (lovasoa) +- Parse SIGNED INTEGER type in MySQL CAST [#1739](https://github.com/apache/datafusion-sqlparser-rs/pull/1739) (mvzink) +- Parse MySQL ALTER TABLE ALGORITHM option [#1745](https://github.com/apache/datafusion-sqlparser-rs/pull/1745) (mvzink) + +## Credits + +Thank you to everyone who contributed to this release. Here is a breakdown of commits (PRs merged) per contributor. + +``` + 10 Yoav Cohen + 9 Ifeanyi Ubah + 6 Michael Victor Zink + 3 Hans Ott + 2 Andrew Lamb + 2 Ophir LOJKINE + 2 Paul Grau + 2 Rémy SAISSY + 2 wugeer + 1 Armin Ronacher + 1 Artem Osipov + 1 AvivDavid-Satori + 1 Ayman Elkfrawy + 1 DanCodedThis + 1 Denys Tsomenko + 1 Emil + 1 Ian Alexander Joiner + 1 Jesse Stuart + 1 Justin Joyce + 1 Michael + 1 SiLe Zhou + 1 Tyler Brinks + 1 benrsatori + 1 gstvg + 1 tomershaniii +``` + +Thank you also to everyone who contributed in other ways such as filing issues, reviewing PRs, and providing feedback on this release. + From ca0ee3c783a095ed6461915187ce85857501c913 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 26 Feb 2025 16:39:51 -0500 Subject: [PATCH 3/9] add entry for 55 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1c55b285..362a637d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ technically be breaking and thus will result in a `0.(N+1)` version. - Unreleased: Check https://github.com/sqlparser-rs/sqlparser-rs/commits/main for undocumented changes. +- `0.55.0`: [changelog/0.55.0.md](changelog/0.55.0.md) - `0.54.0`: [changelog/0.54.0.md](changelog/0.54.0.md) - `0.53.0`: [changelog/0.53.0.md](changelog/0.53.0.md) - `0.52.0`: [changelog/0.52.0.md](changelog/0.52.0.md) From f1249d8faebb125dadc2e8b3dcf9bc1b2ea4b427 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 26 Feb 2025 16:46:54 -0500 Subject: [PATCH 4/9] Highlight breaking changes --- changelog/0.55.0.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/changelog/0.55.0.md b/changelog/0.55.0.md index 02a30ff15..be67e488f 100644 --- a/changelog/0.55.0.md +++ b/changelog/0.55.0.md @@ -19,7 +19,12 @@ under the License. # sqlparser-rs 0.55.0 Changelog -This release consists of 54 commits from 25 contributors. See credits at the end of this changelog for more information. +This release consists of 56 commits from 25 contributors. See credits at the end of this changelog for more information. + +**Breaking changes:** + +- Enhance object name path segments [#1539](https://github.com/apache/datafusion-sqlparser-rs/pull/1539) (ayman-sigma) +- Store spans for Value expressions [#1738](https://github.com/apache/datafusion-sqlparser-rs/pull/1738) (lovasoa) **Implemented enhancements:** @@ -37,7 +42,6 @@ This release consists of 54 commits from 25 contributors. See credits at the end - National strings: check if dialect supports backslash escape [#1672](https://github.com/apache/datafusion-sqlparser-rs/pull/1672) (hansott) - Only support escape literals for Postgres, Redshift and generic dialect [#1674](https://github.com/apache/datafusion-sqlparser-rs/pull/1674) (hansott) - BigQuery: Support trailing commas in column definitions list [#1682](https://github.com/apache/datafusion-sqlparser-rs/pull/1682) (iffyio) -- Enhance object name path segments [#1539](https://github.com/apache/datafusion-sqlparser-rs/pull/1539) (ayman-sigma) - Enable GROUP BY exp for Snowflake dialect [#1683](https://github.com/apache/datafusion-sqlparser-rs/pull/1683) (yoavcloud) - Add support for parsing empty dictionary expressions [#1684](https://github.com/apache/datafusion-sqlparser-rs/pull/1684) (yoavcloud) - Support multiple tables in `UPDATE FROM` clause [#1681](https://github.com/apache/datafusion-sqlparser-rs/pull/1681) (iffyio) @@ -79,7 +83,6 @@ This release consists of 54 commits from 25 contributors. See credits at the end - Parse casting to array using double colon operator in Redshift [#1737](https://github.com/apache/datafusion-sqlparser-rs/pull/1737) (yoavcloud) - Replace parallel condition/result vectors with single CaseWhen vector in Expr::Case [#1733](https://github.com/apache/datafusion-sqlparser-rs/pull/1733) (lovasoa) - BigQuery: Add support for `BEGIN` [#1718](https://github.com/apache/datafusion-sqlparser-rs/pull/1718) (iffyio) -- Store spans for Value expressions [#1738](https://github.com/apache/datafusion-sqlparser-rs/pull/1738) (lovasoa) - Parse SIGNED INTEGER type in MySQL CAST [#1739](https://github.com/apache/datafusion-sqlparser-rs/pull/1739) (mvzink) - Parse MySQL ALTER TABLE ALGORITHM option [#1745](https://github.com/apache/datafusion-sqlparser-rs/pull/1745) (mvzink) @@ -91,8 +94,8 @@ Thank you to everyone who contributed to this release. Here is a breakdown of co 10 Yoav Cohen 9 Ifeanyi Ubah 6 Michael Victor Zink + 4 Andrew Lamb 3 Hans Ott - 2 Andrew Lamb 2 Ophir LOJKINE 2 Paul Grau 2 Rémy SAISSY From 21d1ab0f846510a525bc625b482c10f45dc2e4e5 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 26 Feb 2025 16:49:49 -0500 Subject: [PATCH 5/9] Fix accounting --- changelog/0.55.0.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog/0.55.0.md b/changelog/0.55.0.md index be67e488f..7dd8e3fb0 100644 --- a/changelog/0.55.0.md +++ b/changelog/0.55.0.md @@ -19,7 +19,7 @@ under the License. # sqlparser-rs 0.55.0 Changelog -This release consists of 56 commits from 25 contributors. See credits at the end of this changelog for more information. +This release consists of 53 commits from 25 contributors. See credits at the end of this changelog for more information. **Breaking changes:** @@ -94,12 +94,12 @@ Thank you to everyone who contributed to this release. Here is a breakdown of co 10 Yoav Cohen 9 Ifeanyi Ubah 6 Michael Victor Zink - 4 Andrew Lamb 3 Hans Ott 2 Ophir LOJKINE 2 Paul Grau 2 Rémy SAISSY 2 wugeer + 1 Andrew Lamb 1 Armin Ronacher 1 Artem Osipov 1 AvivDavid-Satori From f9258d5b62a4a5c1e99fed3830a90f50c726e457 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Thu, 27 Feb 2025 12:12:02 -0500 Subject: [PATCH 6/9] Update changelog/0.55.0.md Co-authored-by: Ophir LOJKINE --- changelog/0.55.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/0.55.0.md b/changelog/0.55.0.md index 7dd8e3fb0..337ca8a04 100644 --- a/changelog/0.55.0.md +++ b/changelog/0.55.0.md @@ -81,7 +81,7 @@ This release consists of 53 commits from 25 contributors. See credits at the end - Extend Visitor trait for Value type [#1725](https://github.com/apache/datafusion-sqlparser-rs/pull/1725) (tomershaniii) - Add support for `ORDER BY ALL` [#1724](https://github.com/apache/datafusion-sqlparser-rs/pull/1724) (PokIsemaine) - Parse casting to array using double colon operator in Redshift [#1737](https://github.com/apache/datafusion-sqlparser-rs/pull/1737) (yoavcloud) -- Replace parallel condition/result vectors with single CaseWhen vector in Expr::Case [#1733](https://github.com/apache/datafusion-sqlparser-rs/pull/1733) (lovasoa) +- Replace parallel condition/result vectors with single CaseWhen vector in Expr::Case. This fixes the iteration order when using the `Visitor` trait. Expressions are now visited in the same order as they appear in the sql source. [#1733](https://github.com/apache/datafusion-sqlparser-rs/pull/1733) (lovasoa) - BigQuery: Add support for `BEGIN` [#1718](https://github.com/apache/datafusion-sqlparser-rs/pull/1718) (iffyio) - Parse SIGNED INTEGER type in MySQL CAST [#1739](https://github.com/apache/datafusion-sqlparser-rs/pull/1739) (mvzink) - Parse MySQL ALTER TABLE ALGORITHM option [#1745](https://github.com/apache/datafusion-sqlparser-rs/pull/1745) (mvzink) From f344a3c544ebf3d0b8b77ff1e93e48f9882436d5 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Thu, 27 Feb 2025 12:14:36 -0500 Subject: [PATCH 7/9] Update changelog --- changelog/0.55.0.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/changelog/0.55.0.md b/changelog/0.55.0.md index 337ca8a04..e1b908198 100644 --- a/changelog/0.55.0.md +++ b/changelog/0.55.0.md @@ -19,7 +19,7 @@ under the License. # sqlparser-rs 0.55.0 Changelog -This release consists of 53 commits from 25 contributors. See credits at the end of this changelog for more information. +This release consists of 55 commits from 25 contributors. See credits at the end of this changelog for more information. **Breaking changes:** @@ -85,6 +85,8 @@ This release consists of 53 commits from 25 contributors. See credits at the end - BigQuery: Add support for `BEGIN` [#1718](https://github.com/apache/datafusion-sqlparser-rs/pull/1718) (iffyio) - Parse SIGNED INTEGER type in MySQL CAST [#1739](https://github.com/apache/datafusion-sqlparser-rs/pull/1739) (mvzink) - Parse MySQL ALTER TABLE ALGORITHM option [#1745](https://github.com/apache/datafusion-sqlparser-rs/pull/1745) (mvzink) +- Random test cleanups use Expr::value [#1749](https://github.com/apache/datafusion-sqlparser-rs/pull/1749) (alamb) +- Parse ALTER TABLE AUTO_INCREMENT operation for MySQL [#1748](https://github.com/apache/datafusion-sqlparser-rs/pull/1748) (mvzink) ## Credits @@ -93,13 +95,13 @@ Thank you to everyone who contributed to this release. Here is a breakdown of co ``` 10 Yoav Cohen 9 Ifeanyi Ubah - 6 Michael Victor Zink + 7 Michael Victor Zink 3 Hans Ott + 2 Andrew Lamb 2 Ophir LOJKINE 2 Paul Grau 2 Rémy SAISSY 2 wugeer - 1 Andrew Lamb 1 Armin Ronacher 1 Artem Osipov 1 AvivDavid-Satori From db7911bce4b425edc1df485fa4449c06dbaad678 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Thu, 27 Feb 2025 12:16:02 -0500 Subject: [PATCH 8/9] Add migration guide --- changelog/0.55.0.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/changelog/0.55.0.md b/changelog/0.55.0.md index e1b908198..64494b0eb 100644 --- a/changelog/0.55.0.md +++ b/changelog/0.55.0.md @@ -21,6 +21,27 @@ under the License. This release consists of 55 commits from 25 contributors. See credits at the end of this changelog for more information. +## Migrating usages of `Expr::Value` + +In v0.55, sqlparser the `Expr::Value` enum variant contains a `ValueWithSpan` instead of a `Value`. Here is how to migrate. + +### When pattern matching + +```diff +- Expr::Value(Value::SingleQuotedString(my_string)) => { ... } ++ Expr::Value(ValueWithSpan{ value: Value::SingleQuotedString(my_string), span: _ }) => { ... } +``` + +### When creating an `Expr` + +Use the new `Expr::value` method (notice the lowercase `v`), which will create a `ValueWithSpan` containing an empty span : + +```diff +- Expr::Value(Value::SingleQuotedString(my_string)) ++ Expr::value(Value::SingleQuotedString(my_string)) +``` + + **Breaking changes:** - Enhance object name path segments [#1539](https://github.com/apache/datafusion-sqlparser-rs/pull/1539) (ayman-sigma) From 15f99a6bdf9e6966e0d5079b2c4ec951b424e985 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Thu, 27 Feb 2025 12:25:38 -0500 Subject: [PATCH 9/9] Add notes about ObjectName --- changelog/0.55.0.md | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/changelog/0.55.0.md b/changelog/0.55.0.md index 64494b0eb..046bf22bc 100644 --- a/changelog/0.55.0.md +++ b/changelog/0.55.0.md @@ -23,7 +23,7 @@ This release consists of 55 commits from 25 contributors. See credits at the end ## Migrating usages of `Expr::Value` -In v0.55, sqlparser the `Expr::Value` enum variant contains a `ValueWithSpan` instead of a `Value`. Here is how to migrate. +In v0.55 of sqlparser the `Expr::Value` enum variant contains a `ValueWithSpan` instead of a `Value`. Here is how to migrate. ### When pattern matching @@ -34,13 +34,41 @@ In v0.55, sqlparser the `Expr::Value` enum variant contains a `ValueWithSpan` in ### When creating an `Expr` -Use the new `Expr::value` method (notice the lowercase `v`), which will create a `ValueWithSpan` containing an empty span : +Use the new `Expr::value` method (notice the lowercase `v`), which will create a `ValueWithSpan` containing an empty span: ```diff - Expr::Value(Value::SingleQuotedString(my_string)) + Expr::value(Value::SingleQuotedString(my_string)) ``` +## Migrating usages of `ObjectName` + +In v0.55 of sqlparser, the `ObjectName` structure has been changed as shown below. Here is now to migrate. + +```diff +- pub struct ObjectName(pub Vec); ++ pub struct ObjectName(pub Vec) +``` + +### When constructing `ObjectName` + +Use the `From` impl: + +```diff +- name: ObjectName(vec![Ident::new("f")]), ++ name: ObjectName::from(vec![Ident::new("f")]), +``` + +### Accessing Spans + +Use the `span()` function + +```diff +- name.span ++ name.span() +``` + + **Breaking changes:**