You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2025/09/16 18:25:33 UTC

(datafusion-sqlparser-rs) branch gh-readonly-queue/main/pr-2030-70215614747d17ed47234fc0bab85fecfcda1c9a created (now f642dd57)

This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch gh-readonly-queue/main/pr-2030-70215614747d17ed47234fc0bab85fecfcda1c9a
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git


      at f642dd57 DuckDB: Allow quoted date parts in EXTRACT (#2030)

This branch includes the following new commits:

     new f642dd57 DuckDB: Allow quoted date parts in EXTRACT (#2030)

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.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org


(datafusion-sqlparser-rs) 01/01: DuckDB: Allow quoted date parts in EXTRACT (#2030)

Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch gh-readonly-queue/main/pr-2030-70215614747d17ed47234fc0bab85fecfcda1c9a
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git

commit f642dd573cbf700b8591eeb9e1f6bf3ed8f98659
Author: Ryan Schneider <ry...@gmail.com>
AuthorDate: Tue Sep 16 11:25:24 2025 -0700

    DuckDB: Allow quoted date parts in EXTRACT (#2030)
---
 src/dialect/duckdb.rs     | 5 +++++
 tests/sqlparser_duckdb.rs | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/src/dialect/duckdb.rs b/src/dialect/duckdb.rs
index 37cf7d36..f08d827b 100644
--- a/src/dialect/duckdb.rs
+++ b/src/dialect/duckdb.rs
@@ -70,6 +70,11 @@ impl Dialect for DuckDbDialect {
         true
     }
 
+    /// Returns true if this dialect allows the `EXTRACT` function to use single quotes in the part being extracted.
+    fn allow_extract_single_quotes(&self) -> bool {
+        true
+    }
+
     // DuckDB is compatible with PostgreSQL syntax for this statement,
     // although not all features may be implemented.
     fn supports_explain_with_utility_options(&self) -> bool {
diff --git a/tests/sqlparser_duckdb.rs b/tests/sqlparser_duckdb.rs
index 5bad7336..0f805195 100644
--- a/tests/sqlparser_duckdb.rs
+++ b/tests/sqlparser_duckdb.rs
@@ -869,3 +869,9 @@ fn test_duckdb_trim() {
         duckdb().parse_sql_statements(error_sql).unwrap_err()
     );
 }
+
+#[test]
+fn parse_extract_single_quotes() {
+    let sql = "SELECT EXTRACT('month' FROM my_timestamp) FROM my_table";
+    duckdb().verified_stmt(sql);
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org