Skip to content

Fix: implement table properties handling for Redshift engine adapter#5788

Merged
StuffbyYuki merged 1 commit into
SQLMesh:mainfrom
simen-strand:fix/redshift-physical-properties
May 29, 2026
Merged

Fix: implement table properties handling for Redshift engine adapter#5788
StuffbyYuki merged 1 commit into
SQLMesh:mainfrom
simen-strand:fix/redshift-physical-properties

Conversation

@simen-strand
Copy link
Copy Markdown
Contributor

Description

Adds support for Redshift physical properties (DISTSTYLE, DISTKEY, SORTKEY) in the RedshiftEngineAdapter

  • Added _build_table_properties_exp method to map physical properties to SQLGlot expressions
  • Supports all Redshift DISTSTYLE values: AUTO, EVEN, KEY, ALL
  • Supports single and multi-column SORTKEY (compound sort keys)
  • Handles both identifier and string literal column references
  • Validates that DISTKEY can be specified with or without explicit DISTSTYLE

Test Plan

  • Adds test cases covering:
    • All DISTSTYLE values
    • DISTKEY with and without explicit DISTSTYLE
    • Multi-column compound sort keys
    • String literal column normalization
    • Model physical_properties integration

Checklist

  • I have run make style and fixed any issues
  • I have added tests for my changes (if applicable)
  • All existing tests pass (make fast-test)
  • My commits are signed off (git commit -s) per the DCO

Signed-off-by: Simen Strand <simen.strand@netcheck.de>
@StuffbyYuki StuffbyYuki force-pushed the fix/redshift-physical-properties branch from 268adb9 to 9c9f734 Compare May 27, 2026 03:39
@StuffbyYuki StuffbyYuki merged commit 3deb1f6 into SQLMesh:main May 29, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants