Skip to content

feat(redshift): make partition vals optional for redshift external tables#364

Open
nitish-raj wants to merge 1 commit intodbt-labs:mainfrom
nitish-raj:feat/fix-redshift-table
Open

feat(redshift): make partition vals optional for redshift external tables#364
nitish-raj wants to merge 1 commit intodbt-labs:mainfrom
nitish-raj:feat/fix-redshift-table

Conversation

@nitish-raj
Copy link

@nitish-raj nitish-raj commented Sep 2, 2025

Description & motivation

Redshift Spectrum doesn’t require partitions to be registered at table-create time. Many users register partitions later via Glue/Athena/event-driven flows. Forcing vals leads to brittle date math or references to partition values that do not exist, and it causes failures when vals are omitted.

Changes

  • Make partition vals optional for Redshift during stage_external_sources .
  • If every partition has vals, generate ALTER TABLE … ADD PARTITION (unchanged).
  • If any partition lacks vals, skip only the partition-registration DDL; table creation and partition columns remain unchanged.

User-visible behavior

  • Before: Missing vals → error ('dict object' has no attribute 'vals').
  • Now: Missing vals → succeeds; no partition DDL is emitted. Existing partitions remain unchanged.

Checklist

  • I have verified that these changes work locally
  • I have updated the README.md (if applicable)
  • I have added an integration test for my fix/feature (if applicable)

@nitish-raj nitish-raj changed the title feat(redshift): make partition vals optional; skip partition DDL when… feat(redshift): make partition vals optional for redshift external tables Sep 2, 2025
@nitish-raj
Copy link
Author

@jeremyyeo Could you please take a look at this PR. It is quite important and fixes a major blocker for external tables setup in Redshift.

Also looks like the snowflake integration test is failing due to access issue, also highlighted in another PR.

Thank you.

@github-actions
Copy link

github-actions bot commented Mar 2, 2026

This PR has been marked as Stale because it has been open with no activity as of late. If you would like the PR to remain open, please comment on the PR or else it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant