You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by lu...@apache.org on 2026/10/17 16:28:51 UTC
(datafusion-sqlparser-rs) branch index-column-opclass-order updated (3b51ecd02 -> 7a1eeb7af)
This is an automated email from the ASF dual-hosted git repository.
LucaCappelletti94 pushed a change to branch index-column-opclass-order
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git
discard 3b51ecd02 Generic: Display the index operator class before the sort options
add e790703ab Parser: fix exponential parse time on nested POSITION calls (#2619)
add dacdbc99c ClickHouse: Support GLOBAL IN / GLOBAL NOT IN (#2598)
add 5d1eaf352 Assert exact errors in negative tests (1/4): PostgreSQL tests (#2628)
add 5d653a257 ci: raise the merge queue status check timeout to 360 minutes (#2638)
add 7cac9e17a MySQL: Add support for `ZEROFILL` on numeric data types (#2636)
add fef1e355f Postgres: support OVERRIDING { SYSTEM | USER } VALUE in INSERT (#2626)
add 92e88502a ClickHouse: Support ON CLUSTER and SETTINGS in DELETE and UPDATE (#2617)
add a6f518bf7 Bump serde_json from 1.0.151 to 1.0.154 (#2637)
add 6434b5a22 Assert exact errors in negative tests (2/4): common and parser unit tests (#2629)
add f1854e47e Assert exact errors in negative tests (3/4): dialect tests (#2630)
add a80289f9f Assert exact errors in negative tests (4/4): deny clippy::assertions_on_result_states (#2631)
add de737560d Deny `clippy::manual_assert_eq` (#2644)
add f88f68507 Parser: Fix array suffixes after a `>>` that closes two nested types (#2643)
add 942f36afc SQLite: Support comma-separated WITHOUT ROWID and STRICT table options (#2575)
add c62f01d93 PostgreSQL: Remove unreachable empty op_types branch in operator FUNCTION items (#2632)
add 8338588e9 Commit the fuzz crate's Cargo.lock (#2647)
add 7d34c89b7 Deny `clippy::should_panic_without_expect` (#2648)
add 66d90faaa SetExpr: apply recursive-protection to Display (#2623)
add dcbc923dd MySQL: Bind && with the precedence of AND (#2576)
add c98351352 Postgres: Support aliases for JOIN USING (#2492)
add 0ab37b9e2 SQLite: Support `$` inside identifiers (#2554)
add 5a975d0f4 Deny `clippy::ignore_without_reason` (#2652)
add 7b5821dd4 Deny `clippy::allow_attributes` and `allow_attributes_without_reason` (#2653)
add 1aabd12d1 Add `Dialect::supports_cte_materialization` and enable it for DuckDB (#2651)
new 7a1eeb7af PostgreSQL: Display the index operator class before the sort options
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (3b51ecd02)
\
N -- N -- N refs/heads/index-column-opclass-order (7a1eeb7af)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.asf.yaml | 37 +
.github/dependabot.yml | 5 +
Cargo.lock | 4 +-
Cargo.toml | 8 +
fuzz/.gitignore | 1 -
fuzz/Cargo.lock | 1139 ++++++++++++++++++++++++++++++
fuzz/fuzz_seeds/clickhouse_delete.sql | 5 +
fuzz/fuzz_seeds/clickhouse_global_in.sql | 63 ++
fuzz/fuzz_seeds/clickhouse_update.sql | 5 +
src/ast/data_type.rs | 5 +
src/ast/ddl.rs | 62 +-
src/ast/dml.rs | 56 ++
src/ast/helpers/stmt_create_table.rs | 31 +-
src/ast/mod.rs | 38 +-
src/ast/query.rs | 7 +-
src/ast/spans.rs | 71 +-
src/dialect/clickhouse.rs | 5 +
src/dialect/duckdb.rs | 4 +
src/dialect/generic.rs | 4 +
src/dialect/mod.rs | 47 +-
src/dialect/mysql.rs | 16 +-
src/dialect/postgresql.rs | 4 +
src/dialect/snowflake.rs | 6 +-
src/dialect/sqlite.rs | 2 +-
src/keywords.rs | 7 +-
src/lib.rs | 9 +-
src/parser/mod.rs | 219 +++++-
src/tokenizer.rs | 5 +-
tests/no_std_recursion.rs | 14 +-
tests/sqlparser_bigquery.rs | 39 +-
tests/sqlparser_clickhouse.rs | 320 ++++++++-
tests/sqlparser_common.rs | 670 ++++++++++++------
tests/sqlparser_custom_dialect.rs | 22 +-
tests/sqlparser_databricks.rs | 39 +-
tests/sqlparser_derive_dialect.rs | 12 +-
tests/sqlparser_duckdb.rs | 15 +-
tests/sqlparser_mssql.rs | 87 ++-
tests/sqlparser_mysql.rs | 213 ++++--
tests/sqlparser_postgres.rs | 992 +++++++++++++-------------
tests/sqlparser_redshift.rs | 10 +-
tests/sqlparser_regression.rs | 3 +-
tests/sqlparser_snowflake.rs | 172 +++--
tests/sqlparser_sqlite.rs | 136 +++-
tests/sqlparser_teradata.rs | 10 +-
44 files changed, 3588 insertions(+), 1031 deletions(-)
create mode 100644 fuzz/Cargo.lock
create mode 100644 fuzz/fuzz_seeds/clickhouse_delete.sql
create mode 100644 fuzz/fuzz_seeds/clickhouse_global_in.sql
create mode 100644 fuzz/fuzz_seeds/clickhouse_update.sql
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org
(datafusion-sqlparser-rs) 01/01: PostgreSQL: Display the index operator class before the sort options
Posted by lu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
LucaCappelletti94 pushed a commit to branch index-column-opclass-order
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git
commit 7a1eeb7af2cefd5a6a003090238cad791a8307f0
Author: LucaCappelletti94 <ca...@gmail.com>
AuthorDate: Wed Sep 23 07:06:03 2026 +0200
PostgreSQL: Display the index operator class before the sort options
---
src/ast/ddl.rs | 4 ++--
src/ast/query.rs | 9 ++++++++-
tests/sqlparser_common.rs | 24 ++++++++++++++++++++++++
3 files changed, 34 insertions(+), 3 deletions(-)
diff --git a/src/ast/ddl.rs b/src/ast/ddl.rs
index 5d5b964d1..3ff6de162 100644
--- a/src/ast/ddl.rs
+++ b/src/ast/ddl.rs
@@ -85,11 +85,11 @@ impl<'a> From<&'a str> for IndexColumn {
impl fmt::Display for IndexColumn {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "{}", self.column)?;
+ write!(f, "{}", self.column.expr)?;
if let Some(operator_class) = &self.operator_class {
write!(f, " {operator_class}")?;
}
- Ok(())
+ self.column.fmt_sort_modifiers(f)
}
}
diff --git a/src/ast/query.rs b/src/ast/query.rs
index 4aa82c7c3..40bf671b6 100644
--- a/src/ast/query.rs
+++ b/src/ast/query.rs
@@ -2981,8 +2981,15 @@ impl From<Ident> for OrderByExpr {
impl fmt::Display for OrderByExpr {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.expr)?;
+ self.fmt_sort_modifiers(f)
+ }
+}
+
+impl OrderByExpr {
+ /// Writes the modifiers that follow the sort expression (`ASC`/`DESC`, `NULLS`, `WITH FILL`).
+ pub(crate) fn fmt_sort_modifiers(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.options)?;
- if let Some(ref with_fill) = self.with_fill {
+ if let Some(with_fill) = &self.with_fill {
write!(f, " {with_fill}")?
}
Ok(())
diff --git a/tests/sqlparser_common.rs b/tests/sqlparser_common.rs
index 1959bcd34..c62c36514 100644
--- a/tests/sqlparser_common.rs
+++ b/tests/sqlparser_common.rs
@@ -20699,3 +20699,27 @@ fn parse_cte_materialization() {
}
}
}
+
+#[test]
+fn parse_create_index_operator_class_before_sort_options() {
+ let dialects = all_dialects();
+ dialects.verified_stmt("CREATE INDEX ii ON t(c)");
+ dialects.verified_stmt("CREATE INDEX ii ON t(c ops)");
+ dialects.verified_stmt("CREATE INDEX ii ON t(c DESC)");
+ dialects.verified_stmt("CREATE INDEX ii ON t(c ops DESC)");
+ dialects.verified_stmt("CREATE INDEX ii ON t(c ops DESC NULLS FIRST)");
+
+ let statements = dialects
+ .parse_sql_statements("CREATE INDEX ii ON t(c ops DESC)")
+ .unwrap();
+ let Statement::CreateIndex(create_index) = &statements[0] else {
+ panic!("expected CREATE INDEX")
+ };
+ let column = &create_index.columns[0];
+ assert_eq!(column.column.expr, Expr::Identifier(Ident::new("c")));
+ assert_eq!(
+ column.operator_class,
+ Some(ObjectName::from(vec![Ident::new("ops")]))
+ );
+ assert_eq!(column.column.options.sort, Some(OrderBySort::Desc));
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org