Skip to content

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

Open
simen-strand wants to merge 1 commit intoSQLMesh:mainfrom
simen-strand:fix/redshift-physical-properties
Open

Fix: implement table properties handling for Redshift engine adapter#5788
simen-strand wants to merge 1 commit intoSQLMesh:mainfrom
simen-strand:fix/redshift-physical-properties

Conversation

@simen-strand
Copy link
Copy Markdown

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>
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.

1 participant