Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.
This repository was archived by the owner on May 17, 2024. It is now read-only.

Support key columns of any data type #539

Closed
@mariahjrogers

Description

@mariahjrogers

Is your feature request related to a problem? Please describe.
I am trying to run a diff on a table without one single primary key column, so I'm passing in multiple key columns. Some of these columns are numeric, some are timestamps, and some are VARCHARs. I get an error thrown by the tool when it encounters the TIMESTAMP column: ERROR - Cannot use a column of type Timestamp(precision=6, rounds=True) as a key. I would happily pass it in as a VARCHAR, but I can't modify the type of the field in the table directly, so I tried passing <tstamp_field>::VARCHAR as the key column value, and then got this error: ERROR - Column 'date_day::varchar' not found in table 1.

Describe the solution you'd like
Data-diff should support key columns of any type and handle different types behind the scenes.

Failing that, it would be great to be able to pass in a column with a type cast and not get a "column not found" error.

Describe alternatives you've considered
One alternative to be able to run my diff with non-VARCHAR key columns would be for me to change the types of the columns in my production table, which isn't an acceptable alternative.

Another alternative would be to generate a new column which is a composite key, but this also isn't an acceptable alternative because it requires first modifying the production version of the table before being able to run a diff against it, when the whole point is that I want to diff my changes before making any impact on the production table.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    --dbtIssues/features related to the dbt integrationenhancementNew feature or requeststale_immuneImmunity to stale bot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions