-
Notifications
You must be signed in to change notification settings - Fork 197
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
column-mapping: set schemaID/tableID to 0 if numeric suffix is missing #236
Conversation
@GregoryIan @ericsyh Have we decided to support this? if so, |
We could also agree on a list of acceptable separators so that |
mainly ambiguity problem, I think we can choose one in two way
The reason for this is based on the fact that we should provide a definition that is as simple and nature as possible, not easy to make mistakes. how about you? @kennytm @csuzhangxc |
The second option seems better. I suggest the following changes:
|
it's fine, and we still allow 3 elements arguments which implies |
/run-all-tests |
PTAL @csuzhangxc @GregoryIan @ericsyh |
8d9773b
to
a7fe156
Compare
a7fe156
to
ee8affa
Compare
Rest LGTM |
LGTM @csuzhangxc PTAL |
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.
LGTM. Could you help to update the docs-cn or docs?
pingcap#236) * column-mapping: set schemaID/tableID to 0 if numeric suffix is missing * column-mapping: demand an explicit separator * pkg/column-mapping: addressed comments * column-mapping: addressed comments
* dev/reference/tools/dm: support new column-mapping syntax See pingcap/tidb-tools#236 * dev/reference/tools/dm: explain the prefix in column-mapping can be empty * dev/reference/tools/dm: further refactor the column mapping encoding docs * Apply suggestions from code review Co-Authored-By: Keke Yi <[email protected]>
* diff: add connection manage (#237) * column-mapping: set schemaID/tableID to 0 if numeric suffix is missing (#236) * column-mapping: set schemaID/tableID to 0 if numeric suffix is missing * column-mapping: demand an explicit separator * pkg/column-mapping: addressed comments * column-mapping: addressed comments * diff: some minor fix (#242) * remove row_id (#240) * diff: update column's length for checkpoint table (#245) * diff: add integration test (#239) * diff: fix num is nil (#250)
What problem does this PR solve?
(TOOL-1134) Support mixing names with and without numeric suffix.
What is changed and how it works?
Added an optional separator argument to column mapping. The suffix is extracted as prefix + separator + suffix.
If the name equals to prefix (without the separator), we treat this to mean using a zero numeric suffix, i.e. if
prefix == "money", separator == "_"
:money
→ 0money_
→ errormoney_5
→ 5money_6
→ 6money_7
→ 7money_money_money
→ errormon
→ errornot_money
→ errorCheck List
Tests
Code changes
Side effects
Related changes