I suspect that Redshift does not support named windows, as Postgres has since at least version 8.4:
select stuff
, stuff_category
, sum(dollars) over W
from table
window W as (partition by stuff_category)
However I would like to know definitively and I can't find a reference, or any post that says 'no we didn't implement this for very good reason yada yada.'
The AWS Redshift SQL Reference makes no mention of the 'window as' syntax - I suppose I should take this as an answer.
Here's an SO answer relating to Postgres named windows
Here's the Postgres 8.4 documentation on WINDOW AS ()
syntax
Amazon Redshift supports two types of window functions: aggregate and ranking. These are the supported aggregate functions: AVG. COUNT.
A window function performs a calculation across a set of table rows that are somehow related to the current row. This is comparable to the type of calculation that can be done with an aggregate function.
The SQL language consists of commands that you use to create and manipulate database objects, run queries, load tables, and modify the data in tables. Amazon Redshift is based on PostgreSQL.
Manually move data from Postgres to Redshift using code. You will need to create pipelines that extract data from its source (Postgres), transform the data into the correct format, and load it to the final destination (Redshift) via a process called extract, transform and load (ETL).
Redshift does not support named windows.
As I have learned over time, the RS documentation will specify what is supported and if not mentioned its safe to assume it is not supported. There are no easter eggs or undocumented features to try and find, Legend of Zelda style.
AWS Window Function Documentation
AWS Docs Redshift and Postgres Comparison This does not mention window functions, but is a good resource for this type of question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With