-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
sql: refactored diff tool strucutres to remove JSON complexity #70952
Conversation
Thank you for contributing to CockroachDB. Please ensure you have followed the guidelines for creating a PR. My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
4d07915
to
236fe97
Compare
Thank you for updating your pull request. My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
236fe97
to
1dc82a2
Compare
614b4dc
to
0c05da6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @mnovelodou and @RichardJCai)
pkg/sql/testdata/postgres_test_expected_diffs_on_pg_catalog.json, line 8 at r1 (raw file):
"MissingTables": 0, "MissingColumns": 0, "DatatypeMismatches": 0
just curious: when did we resolve these dataTypeMisMatches?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @rafiss and @RichardJCai)
pkg/sql/testdata/postgres_test_expected_diffs_on_pg_catalog.json, line 8 at r1 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
just curious: when did we resolve these dataTypeMisMatches?
This is a nice catch, if you noticed there are datatype mismatches below, let me check
0c05da6
to
dc982c7
Compare
da7b59d
to
93d6305
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM, minor nits. Awesome change though thanks for this.
Reviewed all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @mnovelodou and @rafiss)
pkg/sql/pg_metadata_diff.go, line 60 at r2 (raw file):
} // PGMetadataColumnDiff describes diffs information for a column type. Fields are exported for Marshaling purposes.
nit: Lower case marshaling
pkg/sql/pg_metadata_diff.go, line 71 at r2 (raw file):
type PGMetadataColumnDiffs map[string]*PGMetadataColumnDiff // PGMetadataTableDiffs Is used to store and load expected diffs:
nit: s/Is/is
pkg/sql/pg_metadata_test.go, line 95 at r2 (raw file):
// Where to start when debugging? // -> func TestDiffTool //
Nice, thanks for this detailed writeup here.
pkg/sql/pg_metadata_test.go, line 267 at r2 (raw file):
} type DiffTool struct {
Nit: Maybe we should use a more specific name here, VirtualSchemaDiffTool perhaps?
Previously, diff tool shared the same structures for table metadata and diffs This was inadequate because they have different concerns To address this, this patch refactored the code so every concern or process have their own data types Release note: None
93d6305
to
afb0f1f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @rafiss and @RichardJCai)
pkg/sql/pg_metadata_test.go, line 95 at r2 (raw file):
Previously, RichardJCai (Richard Cai) wrote…
Nice, thanks for this detailed writeup here.
Done.
bors r+ |
Build succeeded: |
Previously, diff tool shared the same structures for table metadata
and diffs
This was inadequate because they have different concerns
To address this, this patch refactored the code so every concern or
process have their own data types
Release note: None