Skip to content
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

dm table-routing need support regular expressions #4256

Closed
glkappe opened this issue Jan 10, 2022 · 2 comments · Fixed by #4358
Closed

dm table-routing need support regular expressions #4256

glkappe opened this issue Jan 10, 2022 · 2 comments · Fixed by #4358
Assignees
Labels
area/dm Issues or PRs related to DM. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. subject/new-feature Denotes an issue or pull request adding a new feature. type/feature Issues about a new feature

Comments

@glkappe
Copy link

glkappe commented Jan 10, 2022

demand:

db list: test
table list:
t_1
t_2
t_11
t_12

now,table routing need write:

routes:
  r1:
    s-p: 'test'
    t-p: 't_[0-9]'
    t-s: 'test'
    t-t: 't'
  r2:
    s-p: 'test'
    t-p: 't_[0-9][0-9]'
    t-s: 'test'
    t-t: 't'
  r3:
    t-s: 'test'
    s-p: 'test'

i wish:

routes:
  r1:
    s-p: 'test'
    t-p: '~t_*'
    t-s: 'test'
    t-t: 't'

include version:
v2.x
v1.x
v5.3.0

@lance6716 lance6716 transferred this issue from pingcap/tidb Jan 10, 2022
@lance6716 lance6716 added subject/new-feature Denotes an issue or pull request adding a new feature. area/dm Issues or PRs related to DM. labels Jan 10, 2022
@pingcap pingcap deleted a comment from ti-chi-bot Jan 11, 2022
@niubell niubell added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 11, 2022
@D3Hunter
Copy link
Contributor

you can use wildcard matching to get the same effects, check this:

routes:                           # The routing mapping rule set between the data source tables and downstream TiDB tables. You can set multiple rules at the same time.
  route-rule-1:                   # The name of the routing mapping rule.
    schema-pattern: "test"      # The pattern of the upstream schema name. Wildcard characters (*?) are supported.
    table-pattern: "t_*"          # The pattern of the upstream table name. Wildcard characters (*?) are supported.
    target-schema: "test"         # The name of the downstream TiDB schema.
    target-table: "t"             # The name of the downstream TiDB table.

@D3Hunter D3Hunter added question Further information is requested. and removed question Further information is requested. labels Jan 11, 2022
@buchuitoudegou buchuitoudegou self-assigned this Jan 12, 2022
@buchuitoudegou buchuitoudegou linked a pull request Jan 17, 2022 that will close this issue
@buchuitoudegou
Copy link
Contributor

Technical Design of the New Router

The new router reuses the filter module in the tidb-tools project, which is able to recognize regular expressions and matches them against input strings. The filter has also been part of the block-allow-list and thus, reusing the filter module ensures consistency amongst all the components.

@lance6716 lance6716 added the type/feature Issues about a new feature label Feb 16, 2022
zhaoxinyu pushed a commit to zhaoxinyu/ticdc that referenced this issue Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dm Issues or PRs related to DM. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. subject/new-feature Denotes an issue or pull request adding a new feature. type/feature Issues about a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants