datafold/data-diff

The primary key is not a number, and is a joint primary key, how should you compare the data?

acracker opened this issue · 3 comments

There is a daily price table of a commodity in each of the two MYSQL, the primary key is id, and the commodity + date is unique in the table. I need to compare whether the price of each commodity in the two databases is the same every day, or whether there is any deficiency. What should I do?

Can you create a UUID from the two columns so it's alphanumeric?

CREATE TABLE YourTable (
    column1 VARCHAR(36) NOT NULL,
    column2 VARCHAR(36) NOT NULL,
    uuid AS (CONCAT(column1, '-', column2)) PERSISTENT PRIMARY KEY
);

This issue has been marked as stale because it has been open for 60 days with no activity. If you would like the issue to remain open, please comment on the issue and it will be added to the triage queue. Otherwise, it will be closed in 7 days.

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment and it will be reopened for triage.