v0.74.md 2.4 KB


title: "Materialize v0.74" date: 2023-10-25 released: true

patch: 2

v0.74.0

[//]: # "NOTE(morsapaes) v0.74 shipped the ALTER SCHEMA...RENAME command behind a feature flag. This work makes progress towards supporting blue/green deployments."

SQL

  • Bring back support for window aggregations, or aggregate functions (e.g., sum, avg) that use an OVER clause.

    CREATE TABLE sales(time int, amount int);
    
    INSERT INTO sales VALUES (1,3), (2,6), (3,1), (4,5), (5,5), (6,6);
    
    SELECT time, amount, SUM(amount) OVER (ORDER BY time) AS cumulative_amount
    FROM sales
    ORDER BY time;
    
    time | amount | cumulative_amount
    ------+--------+-------------------
      1 |      3 |                 3
      2 |      6 |                 9
      3 |      1 |                10
      4 |      5 |                15
      5 |      5 |                20
      6 |      6 |                26
    

For an overview of window function support, check the updated documentation.

| Command | Description | | ---------------------------------------------------------- | ---------------------------------------------------- | | SHOW PRIVILEGES | Lists the privileges granted on all objects. | | SHOW ROLE MEMBERSHIP | Lists the members of each role. | | SHOW DEFAULT PRIVILEGES | Lists any default privileges granted on any objects. |

Bug fixes and other improvements

  • Improve error message for possibly mistyped column names, suggesting similarly named columns if the one specified cannot be found.

    CREATE SOURCE case_sensitive_names
    FROM POSTGRES CONNECTION pg (
    PUBLICATION 'mz_source',
    TEXT COLUMNS [pk_table."F2"]
    )
    FOR TABLES (
    "enum_table"
    );
    contains: invalid TEXT COLUMNS option value: column "pk_table.F2" does not exist
    hint: The similarly named column "pk_table.f2" does exist.
    
  • Fix a bug where ASSERT NOT NULL options on materialized views were not persisted across restarts of the environment.