Skip to content

Commit e064650

Browse files
committed
Merge remote-tracking branch 'origin' into support-more-pipe-operators
2 parents 324ad14 + 3bc9423 commit e064650

40 files changed

+1912
-606
lines changed

.github/workflows/license.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: license
19+
20+
# trigger for all PRs and changes to main
21+
on:
22+
push:
23+
branches:
24+
- main
25+
pull_request:
26+
27+
jobs:
28+
29+
rat:
30+
name: Release Audit Tool (RAT)
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Setup Python
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: 3.8
38+
- name: Audit licenses
39+
run: ./dev/release/run-rat.sh .

.github/workflows/rust.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ name: Rust
1919

2020
on: [push, pull_request]
2121

22+
permissions:
23+
contents: read
24+
2225
jobs:
2326

2427
codestyle:
@@ -85,11 +88,8 @@ jobs:
8588
uses: ./.github/actions/setup-builder
8689
with:
8790
rust-version: ${{ matrix.rust }}
91+
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
8892
- name: Install Tarpaulin
89-
uses: actions-rs/[email protected]
90-
with:
91-
crate: cargo-tarpaulin
92-
version: 0.14.2
93-
use-tool-cache: true
93+
run: cargo install cargo-tarpaulin
9494
- name: Test
9595
run: cargo test --all-features

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"
2020
description = "Extensible SQL Lexer and Parser with support for ANSI SQL:2011"
21-
version = "0.56.0"
21+
version = "0.57.0"
2222
authors = ["Apache DataFusion <[email protected]>"]
2323
homepage = "https://github.com/apache/datafusion-sqlparser-rs"
2424
documentation = "https://docs.rs/sqlparser/"

changelog/0.57.0.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
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.57.0 Changelog
21+
22+
This release consists of 39 commits from 19 contributors. See credits at the end of this changelog for more information.
23+
24+
**Implemented enhancements:**
25+
26+
- feat: Hive: support `SORT BY` direction [#1873](https://github.com/apache/datafusion-sqlparser-rs/pull/1873) (chenkovsky)
27+
28+
**Other:**
29+
30+
- Support some of pipe operators [#1759](https://github.com/apache/datafusion-sqlparser-rs/pull/1759) (simonvandel)
31+
- Added support for `DROP DOMAIN` [#1828](https://github.com/apache/datafusion-sqlparser-rs/pull/1828) (LucaCappelletti94)
32+
- Improve support for cursors for SQL Server [#1831](https://github.com/apache/datafusion-sqlparser-rs/pull/1831) (aharpervc)
33+
- Add all missing table options to be handled in any order [#1747](https://github.com/apache/datafusion-sqlparser-rs/pull/1747) (benrsatori)
34+
- Add `CREATE TRIGGER` support for SQL Server [#1810](https://github.com/apache/datafusion-sqlparser-rs/pull/1810) (aharpervc)
35+
- Added support for `CREATE DOMAIN` [#1830](https://github.com/apache/datafusion-sqlparser-rs/pull/1830) (LucaCappelletti94)
36+
- Allow stored procedures to be defined without `BEGIN`/`END` [#1834](https://github.com/apache/datafusion-sqlparser-rs/pull/1834) (aharpervc)
37+
- Add support for the MATCH and REGEXP binary operators [#1840](https://github.com/apache/datafusion-sqlparser-rs/pull/1840) (lovasoa)
38+
- Fix: parsing ident starting with underscore in certain dialects [#1835](https://github.com/apache/datafusion-sqlparser-rs/pull/1835) (MohamedAbdeen21)
39+
- implement pretty-printing with `{:#}` [#1847](https://github.com/apache/datafusion-sqlparser-rs/pull/1847) (lovasoa)
40+
- Fix big performance issue in string serialization [#1848](https://github.com/apache/datafusion-sqlparser-rs/pull/1848) (lovasoa)
41+
- Add support for `DENY` statements [#1836](https://github.com/apache/datafusion-sqlparser-rs/pull/1836) (aharpervc)
42+
- Postgresql: Add `REPLICA IDENTITY` operation for `ALTER TABLE` [#1844](https://github.com/apache/datafusion-sqlparser-rs/pull/1844) (MohamedAbdeen21)
43+
- Add support for INCLUDE/EXCLUDE NULLS for UNPIVOT [#1849](https://github.com/apache/datafusion-sqlparser-rs/pull/1849) (Vedin)
44+
- pretty print improvements [#1851](https://github.com/apache/datafusion-sqlparser-rs/pull/1851) (lovasoa)
45+
- fix new rust 1.87 cargo clippy warnings [#1856](https://github.com/apache/datafusion-sqlparser-rs/pull/1856) (lovasoa)
46+
- Update criterion requirement from 0.5 to 0.6 in /sqlparser_bench [#1857](https://github.com/apache/datafusion-sqlparser-rs/pull/1857) (dependabot[bot])
47+
- pretty-print CREATE TABLE statements [#1854](https://github.com/apache/datafusion-sqlparser-rs/pull/1854) (lovasoa)
48+
- pretty-print CREATE VIEW statements [#1855](https://github.com/apache/datafusion-sqlparser-rs/pull/1855) (lovasoa)
49+
- Handle optional datatypes properly in `CREATE FUNCTION` statements [#1826](https://github.com/apache/datafusion-sqlparser-rs/pull/1826) (LucaCappelletti94)
50+
- Mysql: Add `SRID` column option [#1852](https://github.com/apache/datafusion-sqlparser-rs/pull/1852) (MohamedAbdeen21)
51+
- Add support for table valued functions for SQL Server [#1839](https://github.com/apache/datafusion-sqlparser-rs/pull/1839) (aharpervc)
52+
- Keep the COLUMN keyword only if it exists when dropping the column [#1862](https://github.com/apache/datafusion-sqlparser-rs/pull/1862) (git-hulk)
53+
- Add support for parameter default values in SQL Server [#1866](https://github.com/apache/datafusion-sqlparser-rs/pull/1866) (aharpervc)
54+
- Add support for `TABLESAMPLE` pipe operator [#1860](https://github.com/apache/datafusion-sqlparser-rs/pull/1860) (hendrikmakait)
55+
- Adds support for mysql's drop index [#1864](https://github.com/apache/datafusion-sqlparser-rs/pull/1864) (dmzmk)
56+
- Fix: GROUPING SETS accept values without parenthesis [#1867](https://github.com/apache/datafusion-sqlparser-rs/pull/1867) (Vedin)
57+
- Add ICEBERG keyword support to ALTER TABLE statement [#1869](https://github.com/apache/datafusion-sqlparser-rs/pull/1869) (osipovartem)
58+
- MySQL: Support `index_name` in FK constraints [#1871](https://github.com/apache/datafusion-sqlparser-rs/pull/1871) (MohamedAbdeen21)
59+
- Postgres: Apply `ONLY` keyword per table in TRUNCATE stmt [#1872](https://github.com/apache/datafusion-sqlparser-rs/pull/1872) (MohamedAbdeen21)
60+
- Fix `CASE` expression spans [#1874](https://github.com/apache/datafusion-sqlparser-rs/pull/1874) (eliaperantoni)
61+
- MySQL: `[[NOT] ENFORCED]` in CHECK constraint [#1870](https://github.com/apache/datafusion-sqlparser-rs/pull/1870) (MohamedAbdeen21)
62+
- Add support for `CREATE SCHEMA WITH ( <properties> )` [#1877](https://github.com/apache/datafusion-sqlparser-rs/pull/1877) (utay)
63+
- Add support for `ALTER TABLE DROP INDEX` [#1865](https://github.com/apache/datafusion-sqlparser-rs/pull/1865) (vimko)
64+
- chore: Replace archived actions-rs/install action [#1876](https://github.com/apache/datafusion-sqlparser-rs/pull/1876) (assignUser)
65+
- Allow `IF NOT EXISTS` after table name for Snowflake [#1881](https://github.com/apache/datafusion-sqlparser-rs/pull/1881) (bombsimon)
66+
- Support `DISTINCT AS { STRUCT | VALUE }` for BigQuery [#1880](https://github.com/apache/datafusion-sqlparser-rs/pull/1880) (bombsimon)
67+
68+
## Credits
69+
70+
Thank you to everyone who contributed to this release. Here is a breakdown of commits (PRs merged) per contributor.
71+
72+
```
73+
7 Ophir LOJKINE
74+
6 Andrew Harper
75+
6 Mohamed Abdeen
76+
3 Luca Cappelletti
77+
2 Denys Tsomenko
78+
2 Simon Sawert
79+
1 Andrew Lamb
80+
1 Artem Osipov
81+
1 Chen Chongchen
82+
1 Dmitriy Mazurin
83+
1 Elia Perantoni
84+
1 Hendrik Makait
85+
1 Jacob Wujciak-Jens
86+
1 Simon Vandel Sillesen
87+
1 Yannick Utard
88+
1 benrsatori
89+
1 dependabot[bot]
90+
1 hulk
91+
1 vimko
92+
```
93+
94+
Thank you also to everyone who contributed in other ways such as filing issues, reviewing PRs, and providing feedback on this release.
95+

dev/release/rat_exclude_files.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Files to exclude from the Apache Rat (license) check
2-
.gitignore
31
.tool-versions
2+
target/*
3+
**.gitignore
4+
rat.txt
45
dev/release/rat_exclude_files.txt
5-
fuzz/.gitignore
66
sqlparser_bench/img/flamegraph.svg
7-
7+
**Cargo.lock
8+
filtered_rat.txt

examples/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ $ cargo run --example cli - [--dialectname]
6363
};
6464

6565
let contents = if filename == "-" {
66-
println!("Parsing from stdin using {:?}", dialect);
66+
println!("Parsing from stdin using {dialect:?}");
6767
let mut buf = Vec::new();
6868
stdin()
6969
.read_to_end(&mut buf)

sqlparser_bench/benches/sqlparser_bench.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,24 @@ fn basic_queries(c: &mut Criterion) {
4545

4646
let large_statement = {
4747
let expressions = (0..1000)
48-
.map(|n| format!("FN_{}(COL_{})", n, n))
48+
.map(|n| format!("FN_{n}(COL_{n})"))
4949
.collect::<Vec<_>>()
5050
.join(", ");
5151
let tables = (0..1000)
52-
.map(|n| format!("TABLE_{}", n))
52+
.map(|n| format!("TABLE_{n}"))
5353
.collect::<Vec<_>>()
5454
.join(" JOIN ");
5555
let where_condition = (0..1000)
56-
.map(|n| format!("COL_{} = {}", n, n))
56+
.map(|n| format!("COL_{n} = {n}"))
5757
.collect::<Vec<_>>()
5858
.join(" OR ");
5959
let order_condition = (0..1000)
60-
.map(|n| format!("COL_{} DESC", n))
60+
.map(|n| format!("COL_{n} DESC"))
6161
.collect::<Vec<_>>()
6262
.join(", ");
6363

6464
format!(
65-
"SELECT {} FROM {} WHERE {} ORDER BY {}",
66-
expressions, tables, where_condition, order_condition
65+
"SELECT {expressions} FROM {tables} WHERE {where_condition} ORDER BY {order_condition}"
6766
)
6867
};
6968

src/ast/data_type.rs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,14 @@ pub enum DataType {
446446
///
447447
/// [PostgreSQL]: https://www.postgresql.org/docs/9.5/functions-geometry.html
448448
GeometricType(GeometricTypeKind),
449+
/// PostgreSQL text search vectors, see [PostgreSQL].
450+
///
451+
/// [PostgreSQL]: https://www.postgresql.org/docs/17/datatype-textsearch.html
452+
TsVector,
453+
/// PostgreSQL text search query, see [PostgreSQL].
454+
///
455+
/// [PostgreSQL]: https://www.postgresql.org/docs/17/datatype-textsearch.html
456+
TsQuery,
449457
}
450458

451459
impl fmt::Display for DataType {
@@ -658,7 +666,7 @@ impl fmt::Display for DataType {
658666
}
659667
DataType::Enum(vals, bits) => {
660668
match bits {
661-
Some(bits) => write!(f, "ENUM{}", bits),
669+
Some(bits) => write!(f, "ENUM{bits}"),
662670
None => write!(f, "ENUM"),
663671
}?;
664672
write!(f, "(")?;
@@ -706,16 +714,16 @@ impl fmt::Display for DataType {
706714
}
707715
// ClickHouse
708716
DataType::Nullable(data_type) => {
709-
write!(f, "Nullable({})", data_type)
717+
write!(f, "Nullable({data_type})")
710718
}
711719
DataType::FixedString(character_length) => {
712-
write!(f, "FixedString({})", character_length)
720+
write!(f, "FixedString({character_length})")
713721
}
714722
DataType::LowCardinality(data_type) => {
715-
write!(f, "LowCardinality({})", data_type)
723+
write!(f, "LowCardinality({data_type})")
716724
}
717725
DataType::Map(key_data_type, value_data_type) => {
718-
write!(f, "Map({}, {})", key_data_type, value_data_type)
726+
write!(f, "Map({key_data_type}, {value_data_type})")
719727
}
720728
DataType::Tuple(fields) => {
721729
write!(f, "Tuple({})", display_comma_separated(fields))
@@ -737,7 +745,9 @@ impl fmt::Display for DataType {
737745
DataType::NamedTable { name, columns } => {
738746
write!(f, "{} TABLE ({})", name, display_comma_separated(columns))
739747
}
740-
DataType::GeometricType(kind) => write!(f, "{}", kind),
748+
DataType::GeometricType(kind) => write!(f, "{kind}"),
749+
DataType::TsVector => write!(f, "TSVECTOR"),
750+
DataType::TsQuery => write!(f, "TSQUERY"),
741751
}
742752
}
743753
}
@@ -932,7 +942,7 @@ impl fmt::Display for CharacterLength {
932942
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
933943
match self {
934944
CharacterLength::IntegerLength { length, unit } => {
935-
write!(f, "{}", length)?;
945+
write!(f, "{length}")?;
936946
if let Some(unit) = unit {
937947
write!(f, " {unit}")?;
938948
}
@@ -987,7 +997,7 @@ impl fmt::Display for BinaryLength {
987997
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
988998
match self {
989999
BinaryLength::IntegerLength { length } => {
990-
write!(f, "{}", length)?;
1000+
write!(f, "{length}")?;
9911001
}
9921002
BinaryLength::Max => {
9931003
write!(f, "MAX")?;

src/ast/dcl.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl fmt::Display for AlterRoleOperation {
173173
in_database,
174174
} => {
175175
if let Some(database_name) = in_database {
176-
write!(f, "IN DATABASE {} ", database_name)?;
176+
write!(f, "IN DATABASE {database_name} ")?;
177177
}
178178

179179
match config_value {
@@ -187,7 +187,7 @@ impl fmt::Display for AlterRoleOperation {
187187
in_database,
188188
} => {
189189
if let Some(database_name) = in_database {
190-
write!(f, "IN DATABASE {} ", database_name)?;
190+
write!(f, "IN DATABASE {database_name} ")?;
191191
}
192192

193193
match config_name {
@@ -218,15 +218,15 @@ impl fmt::Display for Use {
218218
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
219219
f.write_str("USE ")?;
220220
match self {
221-
Use::Catalog(name) => write!(f, "CATALOG {}", name),
222-
Use::Schema(name) => write!(f, "SCHEMA {}", name),
223-
Use::Database(name) => write!(f, "DATABASE {}", name),
224-
Use::Warehouse(name) => write!(f, "WAREHOUSE {}", name),
225-
Use::Role(name) => write!(f, "ROLE {}", name),
221+
Use::Catalog(name) => write!(f, "CATALOG {name}"),
222+
Use::Schema(name) => write!(f, "SCHEMA {name}"),
223+
Use::Database(name) => write!(f, "DATABASE {name}"),
224+
Use::Warehouse(name) => write!(f, "WAREHOUSE {name}"),
225+
Use::Role(name) => write!(f, "ROLE {name}"),
226226
Use::SecondaryRoles(secondary_roles) => {
227-
write!(f, "SECONDARY ROLES {}", secondary_roles)
227+
write!(f, "SECONDARY ROLES {secondary_roles}")
228228
}
229-
Use::Object(name) => write!(f, "{}", name),
229+
Use::Object(name) => write!(f, "{name}"),
230230
Use::Default => write!(f, "DEFAULT"),
231231
}
232232
}

0 commit comments

Comments
 (0)