Help: Can multiple tables be configured under a single rule for DM filter parameter expression-filter?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 求助:DM 过滤参数expression-filter 单个规则下是否可以配置多个表

| username: baozixiaoge

【TiDB Usage Environment】Testing/
【TiDB Version】6.1.2
【Encountered Issue: Problem Description and Impact】
SQL expression filter DML for two tables, tab1 and tab2, in the test database with the same rule. How should the configuration be written, or can the filter rule only correspond to one table?
【Resource Configuration】
expression-filter:
even_a:
schema: “test”
table: ?
delete-value-expr: “is_history = 1”

| username: Hacker007 | Original post link

Regular expressions are not supported. You can refer to DM Task Full Configuration File Introduction | PingCAP Docs.

| username: baozixiaoge | Original post link

Does it only support this mode?
expression-filter:
even_a:
schema: “test”
table: tab1
delete-value-expr: “is_history = 1”
even_b:
schema: “test”
table: tab2
delete-value-expr: “is_history = 1”
Doesn’t the list mode support?
expression-filter:
even_a:
schema: “test”
table: [“tab1”,“tab2”]
delete-value-expr: “is_history = 1”

| username: Hacker007 | Original post link

I suggest you conduct tests in a testing environment and test everything you can think of.

| username: baozixiaoge | Original post link

Tested, the list reported an error. That’s why I posted on the forum for help.
Message: decode task config failed, RawCause: yaml: unmarshal errors:\n line 21: cannot unmarshal !!seq into string
The official documentation only states that wildcards or regular expressions are not supported.


Single table single rule mode works fine. But when there are too many tables, the rollover rules are consistent. The configuration file becomes very long.

| username: Min_Chen | Original post link

Hello, due to the special nature of expression-filter, it currently only supports one table corresponding to one expression-filter, and needs to be configured once for each table.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.