fix(redshift): fix INTERVAL quoting#5545
Conversation
Signed-off-by: Luka Peschke <mail@lukapeschke.com>
|
@priithaamer @eitsupi I'd be happy to have your opinion on this one 🙂 |
|
It seems only |
Signed-off-by: Luka Peschke <mail@lukapeschke.com>
|
@priithaamer You're right, I set the quoting style to The redshift docs does not mention weeks at all 😕 https://docs.aws.amazon.com/redshift/latest/dg/r_interval_data_types.html |
Thanks! I can confirm this works and can be merged. We could also consider dropping direct week support and if possible, in Redshift dialect compile |
|
sorry, I merged the other; would you mind resolving conflicts and then merging? |
|
@max-sixty done :) Can I let you merge and create a new release ? |
|
Sorry for the delay, I'm not currently in a position to test Redshift so I can't be sure this is correct, but the changes seem reasonable. |
Continuing the work in #5540 for intervals.
Unfortunately, there is no "one size fits all" quoting that works for redshift:
INTERVAL '1 year'causes the following error:Interval values with month or year parts are not supportedSELECT CAST((DATE_TRUNC('week', added_date) - INTERVAL '1' WEEK) AS timestamp) AS firstdayofpreviousweekcauses a syntax error:Error occurred while trying to execute a query: [SQLState 42601] ERROR: syntax error at or near \"WEEK\" in context \")However, replacing'1' WEEKwith'1 WEEK'here works.