This is an automated email from the ASF dual-hosted git repository.
iffyio pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git
The following commit(s) were added to refs/heads/main by this push:
new 3ed4ad9c Allow single quotes in EXTRACT() for Redshift. (#1795)
3ed4ad9c is described below
commit 3ed4ad9c66eca16b116be63afaa2d9e383bc2bc1
Author: Roman Borschel <[email protected]>
AuthorDate: Fri Apr 4 22:18:31 2025 +0200
Allow single quotes in EXTRACT() for Redshift. (#1795)
Co-authored-by: Roman Borschel <[email protected]>
---
src/dialect/redshift.rs | 4 ++++
tests/sqlparser_redshift.rs | 6 ++++++
2 files changed, 10 insertions(+)
diff --git a/src/dialect/redshift.rs b/src/dialect/redshift.rs
index 25b8f164..d90eb6e7 100644
--- a/src/dialect/redshift.rs
+++ b/src/dialect/redshift.rs
@@ -121,4 +121,8 @@ impl Dialect for RedshiftSqlDialect {
fn supports_array_typedef_with_brackets(&self) -> bool {
true
}
+
+ fn allow_extract_single_quotes(&self) -> bool {
+ true
+ }
}
diff --git a/tests/sqlparser_redshift.rs b/tests/sqlparser_redshift.rs
index 7736735c..c75abe16 100644
--- a/tests/sqlparser_redshift.rs
+++ b/tests/sqlparser_redshift.rs
@@ -391,3 +391,9 @@ fn test_parse_nested_quoted_identifier() {
.parse_sql_statements(r#"SELECT 1 AS ["1]"#)
.is_err());
}
+
+#[test]
+fn parse_extract_single_quotes() {
+ let sql = "SELECT EXTRACT('month' FROM my_timestamp) FROM my_table";
+ redshift().verified_stmt(&sql);
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]