From 54027b6c2264303cf9f74da20208ef66019ae52c Mon Sep 17 00:00:00 2001 From: Simon Vandel Sillesen Date: Wed, 2 Jul 2025 21:40:01 +0200 Subject: [PATCH] Make GenericDialect support trailing commas in projections Similar to https://github.com/apache/datafusion-sqlparser-rs/pull/1911. The docs for GenericDialect says that is can be permissive, so I thought it could support trailing commas in projections. This would help a bit on the "friendly sql" issue https://github.com/apache/datafusion/issues/14514 --- src/dialect/generic.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dialect/generic.rs b/src/dialect/generic.rs index 59671e21..5e9f2e4e 100644 --- a/src/dialect/generic.rs +++ b/src/dialect/generic.rs @@ -116,6 +116,10 @@ impl Dialect for GenericDialect { true } + fn supports_projection_trailing_commas(&self) -> bool { + true + } + fn supports_asc_desc_in_column_definition(&self) -> bool { true }