Skip to content

Commit 101201d

Browse files
romanbRoman Borschel
authored andcommitted
Allow single quotes in EXTRACT() for Redshift. (apache#1795)
Co-authored-by: Roman Borschel <[email protected]>
1 parent 2b92bfc commit 101201d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/dialect/redshift.rs

+4
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,8 @@ impl Dialect for RedshiftSqlDialect {
121121
fn supports_array_typedef_with_brackets(&self) -> bool {
122122
true
123123
}
124+
125+
fn allow_extract_single_quotes(&self) -> bool {
126+
true
127+
}
124128
}

tests/sqlparser_redshift.rs

+6
Original file line numberDiff line numberDiff line change
@@ -391,3 +391,9 @@ fn test_parse_nested_quoted_identifier() {
391391
.parse_sql_statements(r#"SELECT 1 AS ["1]"#)
392392
.is_err());
393393
}
394+
395+
#[test]
396+
fn parse_extract_single_quotes() {
397+
let sql = "SELECT EXTRACT('month' FROM my_timestamp) FROM my_table";
398+
redshift().verified_stmt(&sql);
399+
}

0 commit comments

Comments
 (0)