New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eliminate column tags, use column name for identity in all cases #3963
Comments
A simpler reproduction of this issue is the following:
|
We added the ability to override the tag system when necessary. This will allow you to unblock yourself if a merge error like this occurs. The command is called dolt schema update-tag. Here is an example on how it can be used: dolt/integration-tests/bats/column_tags.bats Line 334 in 1956ca9
|
I have a simpler ask for this: make tags a storage only detail that never impact the logic of diff and merge. Diff and merge always match by column name. |
@fulghum is going to fix the specific case of two similarly names and schema'ed tables added on different branches that end up with different tags should merge. |
Today, Dolt has an internal tag system that is used to assign identities to columns. The tag system helps Dolt diff and merge columns even when they have been renamed or modified.
For example, let's say I have a users table with a name as the primary key and a phone number stored as an integer. If I rename the phone number column, the internal tag of that column remains the same.
When I merge the users table with the renamed column against another users table with the original columns names, the columns containing the phone numbers are matched by their tags. Their row values are merged.
Depending on the sequence of schema alterations that occur on separate branches. The tags of a column that should be mergeable diverge and the merge aborts. For example, let's continue from above:
The statement that led to this error is:
dolt sql -q "ALTER TABLE users ADD COLUMN side VARCHAR(10) DEFAULT 'dark side'"
The reason why the phone_number column's tag differs between the
main
branchother2
is due to theside
column being added prior to thephone_number
column's modification. Tags are generated in a psuedo-random manner and they are seeded with the underlying representation of the existing columns. Because the existing columns changed on one branch but not the other, the generated tags differed.In the near future, we plan to remove the tag system and improve this unexpected behavior. We encourage you to leave feedback below or a reaction if you run into this issue.
The text was updated successfully, but these errors were encountered: