Skip to content

Fix(redshift): regression in varchar length workaround#3225

Merged
treysp merged 3 commits intomainfrom
trey/redshift-columns-length
Oct 9, 2024
Merged

Fix(redshift): regression in varchar length workaround#3225
treysp merged 3 commits intomainfrom
trey/redshift-columns-length

Conversation

@treysp
Copy link
Copy Markdown
Contributor

@treysp treysp commented Oct 4, 2024

#2791 introduced a regression in the varchar length workaround because it assumed the columns() method returned data types including their length/precision. That was true for MSSQL, but wasn't for Redshift.

This PR updates Redshift's columns() method to attach length/precision to data types.

Note: the _columns_query() method allowed postgres and redshift to use different columns queries inside postgres' columns() method. Redshift now needs to override the entire columns() method, so _columns_query() has been removed from postgres.

@treysp treysp requested a review from a team October 4, 2024 15:52
@treysp treysp force-pushed the trey/redshift-columns-length branch from 80f1433 to b2bfe64 Compare October 4, 2024 15:53
Comment thread sqlmesh/core/engine_adapter/redshift.py Outdated
Comment thread sqlmesh/core/engine_adapter/redshift.py Outdated
Comment thread sqlmesh/core/engine_adapter/redshift.py Outdated
@treysp
Copy link
Copy Markdown
Contributor Author

treysp commented Oct 4, 2024

Feedback addressed, also updated the MSSQL implementation to align

Comment thread sqlmesh/core/engine_adapter/mssql.py Outdated
@georgesittas
Copy link
Copy Markdown
Collaborator

NOTE: redshift integration tests won't pass until sqlglot is bumped > 25.24.4

Released v25.24.5.

@treysp treysp force-pushed the trey/redshift-columns-length branch from 6ffbdd4 to f1d73e0 Compare October 9, 2024 15:06
@treysp treysp merged commit 3acb022 into main Oct 9, 2024
@treysp treysp deleted the trey/redshift-columns-length branch October 9, 2024 15:20
@jrhorne
Copy link
Copy Markdown

jrhorne commented Oct 9, 2024

Will this be included in sqlmesh 0.126.1 or 0.127.0? When is the next release scheduled for?

@treysp
Copy link
Copy Markdown
Contributor Author

treysp commented Oct 9, 2024

@jrhorne Just released v0.126.1, should be available in pypi shortly https://github.com/TobikoData/sqlmesh/releases/tag/v0.126.1

justinjoseph89 added a commit to trygforsikring/sqlmesh that referenced this pull request Oct 21, 2024
* Fix: mark kind changes as breaking in forward only plan (SQLMesh#3207)

* Feat: add support for parameterized python model names (SQLMesh#3208)

* Fix: Bigquery support of complex nested types (SQLMesh#3190)

* Feat: Snowflake: Handle forward_only changes to 'clustered_by' (SQLMesh#3205)

* Docs: add gateway variables to jinja macros concepts doc (SQLMesh#3210)

* Fix: avoid parsing column names into qualified columns in InsertOverwriteWithMergeMixin (SQLMesh#3211)

* Chore: bump sqlglot to v25.24.2 (SQLMesh#3213)

* Feat: Support INCREMENTAL_BY_TIME_RANGE models on Athena/Hive (SQLMesh#3201)

* Fix: load custom materializations on run (SQLMesh#3216)

* Fix: Infer column types when data type is omitted in dbt seeds (SQLMesh#3215)

* Chore: bump sqlglot to v25.24.3 (SQLMesh#3217)

* Fix: DBT seed column order (SQLMesh#3221)

* fix: web reloading caused iteration error (SQLMesh#3220)

* Fix: Make dbt adapter macros available in the local scope (SQLMesh#3219)

* Feat: Support DBT Athena adapter (SQLMesh#3222)

* chore: docs

* Feat: Support SQLMesh project generation from dlt pipeline (SQLMesh#3218)

* Fix: Broken hive distro link in the test airflow image

* Fix: Prevent loaded context from being used concurrently (SQLMesh#3229)

* Fix: Go back to using hive 3.1.3 for the Airflow test image

* Fix: Support of custom roles for Postgres (SQLMesh#3230)

* Fix(redshift): regression in varchar length workaround (SQLMesh#3225)

* Fix: Force the CircleCI's git to use https links when running pre-commit (SQLMesh#3235)

* Fix: reset macro registry *after* loading models (SQLMesh#3232)

* Fix: Modify dlt query filter not to use alias reference (SQLMesh#3233)

* Fix: Support CLUSTER BY clause for the Databricks engine (SQLMesh#3234)

* Feat: BigQuery - Handle forward_only changes to clustered_by (SQLMesh#3231)

* chore: Fix typo in model_kinds.md (SQLMesh#3239)

* Feat: support custom unit testing schema names (SQLMesh#3238)

* Chore: Make the scheduler config extendable (SQLMesh#3242)

* Fix: use parentheses for databricks' CLUSTER BY clause (SQLMesh#3240)

* Fix: handle Paren in depends_on validator (SQLMesh#3243)

* fix: data diff for bigquery project parsing (SQLMesh#3248)

* Chore: Reintroduce parallelism in integration tests (SQLMesh#3236)

* Feat(databricks): Add OAuth support (SQLMesh#3250)

* Chore!: bump sqlglot to v25.25.0 (SQLMesh#3252)

* Adding markdown feature to model description (SQLMesh#3228)

* Fix: refactor table part parsing for Snowflake (SQLMesh#3254)

* Fix: always warn when an audit has failed (SQLMesh#3255)

* Chore: bump sqlglot to v25.25.1 (SQLMesh#3256)

* Ensure using project instead of execution project for temp table as default (SQLMesh#3249)

* Chore: Clarify that restatement plans ignore local changes (SQLMesh#3257)

* feat!: run-all bot command errors if anything within it errors (SQLMesh#3262)

* Fix(clickhouse): remove fractional seconds when time column is datetime/timestamp type (SQLMesh#3261)

* remove risingwave configuration from dbt

* remove sink settings

* remove risngwave sink

* introducing risingwave as state syn engine

* add risingwave connetion as test

* change test case

* Fix: Prevent extraction of dependencies from a rendered query for dbt models (SQLMesh#3263)

---------

Co-authored-by: Ben <9087625+benfdking@users.noreply.github.com>
Co-authored-by: Jo <46752250+georgesittas@users.noreply.github.com>
Co-authored-by: Themis Valtinos <73662635+Themiscodes@users.noreply.github.com>
Co-authored-by: Erin Drummond <erin.dru@gmail.com>
Co-authored-by: Trey Spiller <1831878+treysp@users.noreply.github.com>
Co-authored-by: Alexander Butler <41213451+z3z1ma@users.noreply.github.com>
Co-authored-by: Toby Mao <toby.mao@gmail.com>
Co-authored-by: Iaroslav Zeigerman <zeigerman.ia@gmail.com>
Co-authored-by: Vincent Chan <vchan@users.noreply.github.com>
Co-authored-by: Vaggelis Danias <daniasevangelos@gmail.com>
Co-authored-by: Harmuth94 <86912694+Harmuth94@users.noreply.github.com>
Co-authored-by: Christophe Oudar <kayrnt@gmail.com>
Co-authored-by: Chris Rericha <67359577+crericha@users.noreply.github.com>
Co-authored-by: Ryan Eakman <6326532+eakmanrq@users.noreply.github.com>
Co-authored-by: Justin Joseph <justin.joseph@tryg.dk>
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.

4 participants