Skip to content

Fix Redshift parenthesized single-column SORTKEY#5915

Open
simen-strand wants to merge 2 commits into
SQLMesh:mainfrom
simen-strand:fix/redshift-single-column-sortkey
Open

Fix Redshift parenthesized single-column SORTKEY#5915
simen-strand wants to merge 2 commits into
SQLMesh:mainfrom
simen-strand:fix/redshift-single-column-sortkey

Conversation

@simen-strand

Copy link
Copy Markdown
Contributor

Description

Redshift: adds support for parenthesized single-column sortkey.

SQLGlot parses sortkey = (column) as an exp.Paren, producing invalid Redshift syntax such as SORTKEY((column)).

This change explicitly normalizes tuple, array, parenthesized, and scalar SORTKEY expressions before constructing the SortKeyProperty.

Tests

  • Updated the model-level Redshift physical properties test to cover sortkey = ("value").
  • Ran pytest tests/core/engine_adapter/test_redshift.py -v (37 passed).

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

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