Open dbw9580 opened 3 years ago
@apc999 FYI.
@dbw9580 Thanks for this invention. Please check whether your existing approach support a way to describe only include one or a specific set of tables do not being bypassed, but bypassed others.
After discussion with @maobaolong and @HelloHorizon, the priority is to support regex and exclusion.
I propose the revised and simplified design of the config file:
tables
and partitions
can now accept either a list of names, or an object with an include
and/or an exclude
key, containing table or partition names to include and exclude from the bypass list. The old syntax is still supported, and defaults to an include
list. I.e.,
{
"bypass": {
"tables": [
"table1",
{"table": "table2", "partitions": ["part1", "part2"]}
]
}
}
is equivalent to
{
"bypass": {
"tables": {
"include": [
"table1",
{
"table": "table2",
"partitions": {
"include": ["part1", "part2"]
}
}
]
}
}
}
when both include
and exclude
lists are present, an additional optional option includeFirstOnConflict
can be used to resolve conflicts:
{
"bypass": {
"tables": {
"exclude": [
"table1"
],
"include": [
{"regex": "^table\\d"}
],
"includeFirstOnConflict": true
}
}
}
In the above example, table1
will not be excluded from bypassed tables, i.e. table1
is bypassed from Alluxio, and clients read it directly from UDB.
This option defaults to true
.
a new way to match tables and partitions names by regular expression:
{
"bypass": {
"tables": [
{"regex": "^table\\d"},
{"table": "table2", "partitions": [{"regex": "^part\\d"}]}
]
}
}
This config will bypass (all partitions of) table0
, table1
, and table3
to table9
. For table2
, partitions part0
to part9
will be bypassed, any other partitions, if any, will not.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two weeks if no further activity occurs. Thank you for your contributions.
During review of #13581, @HelloHorizon suggested it should be made more user-friendly to configure bypassed partitions:
@maobaolong offered insights from real use cases:
Describe the solution you'd like
For example:
Describe alternatives you've considered
Open to discussion.
Urgency
Normal