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 2026/08/25 12:22:30 UTC
(datafusion-sqlparser-rs) branch main updated: Redshift: allow INTERVAL as a column name (#2456)
This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] 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 75a10405 Redshift: allow INTERVAL as a column name (#2456)
75a10405 is described below
commit 75a1040597fd6233f24a6b41641b360e30fb01b9
Author: Ben Herzberg <69...@users.noreply.github.com>
AuthorDate: Tue Aug 25 12:20:37 2026 +0000
Redshift: allow INTERVAL as a column name (#2456)
---
src/dialect/redshift.rs | 12 ++++++++++++
tests/sqlparser_redshift.rs | 5 +++++
2 files changed, 17 insertions(+)
diff --git a/src/dialect/redshift.rs b/src/dialect/redshift.rs
index bb48b14e..aa403618 100644
--- a/src/dialect/redshift.rs
+++ b/src/dialect/redshift.rs
@@ -16,9 +16,11 @@
// under the License.
use crate::dialect::Dialect;
+use crate::keywords::Keyword;
use core::iter::Peekable;
use core::str::Chars;
+use super::keywords::RESERVED_FOR_IDENTIFIER;
use super::PostgreSqlDialect;
/// A [`Dialect`] for [RedShift](https://aws.amazon.com/redshift/)
@@ -175,4 +177,14 @@ impl Dialect for RedshiftSqlDialect {
fn supports_window_function_null_treatment_arg(&self) -> bool {
true
}
+
+ /// `INTERVAL` is listed as reserved in Redshift docs but the actual parser allows it as an
+ /// identifier, consistent with pgsql.
+ fn is_reserved_for_identifier(&self, kw: Keyword) -> bool {
+ if matches!(kw, Keyword::INTERVAL) {
+ false
+ } else {
+ RESERVED_FOR_IDENTIFIER.contains(&kw)
+ }
+ }
}
diff --git a/tests/sqlparser_redshift.rs b/tests/sqlparser_redshift.rs
index 197d5b8f..31cc4fe5 100644
--- a/tests/sqlparser_redshift.rs
+++ b/tests/sqlparser_redshift.rs
@@ -552,3 +552,8 @@ fn parse_unpivot_expression() {
);
dialects.verified_stmt("SELECT t.id, k, v FROM test_colors AS t, UNPIVOT t AS v AT k");
}
+
+#[test]
+fn test_interval_as_column_name() {
+ redshift().verified_stmt("SELECT * FROM table_name WHERE interval = 78");
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org