apache/seatunnel · error · IllegalArgumentException

Vitess CDC table-pattern

Error message

Vitess CDC table-pattern '%s' did not match any declared schema table.

What it means

Thrown by filterDeclaredTables when a configured table-pattern regex matches none of the declared schema tables (matched against TablePath.toString()). The connector fails fast instead of proceeding with zero tables.

Solutions

  1. Include the keyspace in the pattern, e.g. "commerce\\..*" or "commerce.orders"
  2. Print/log the declared table paths and adjust the regex to match their exact toString() form
  3. Verify case sensitivity and anchor the pattern correctly (regex must fully match the path)
  4. Fix table names in the pattern after upstream Vitess renames

Example fix

// before
table-pattern = "orders.*"
// after
table-pattern = "commerce\\..*"
Defensive patterns

Strategy: validation

Validate before calling

Pattern p = Pattern.compile(tablePattern);
boolean any = declaredTables.stream().anyMatch(t -> p.matcher(t.getTablePath().toString()).matches());
if (!any) throw new IllegalArgumentException("pattern matches no declared table");

Try / catch

try { factory.resolveCatalogTables(context); } catch (IllegalArgumentException e) { /* adjust regex to declared paths */ }

Prevention

When it happens

Trigger: table-pattern regex that does not match any CatalogTable's table path string among the declared tables during resolveCatalogTables.

Common situations: Regex missing the keyspace prefix (paths are fully qualified, e.g. 'commerce.orders'); case mismatch in the regex; tables renamed in Vitess; escaping issues with '.' in patterns.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/65ef0ae94e8f734a. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-vitess/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/vitess/source/VitessSourceFactory.java:218

                                                                tableName)));
                selectedTables.add(matchedTable);
            }
            return selectedTables;
        }

        Optional<String> tablePattern =
                context.getOptions().getOptional(ConnectorCommonOptions.TABLE_PATTERN);
        if (tablePattern.isPresent()) {
            Pattern regex = Pattern.compile(tablePattern.get());
            List<CatalogTable> selectedTables =
                    declaredTables.stream()
                            .filter(
                                    table ->
                                            regex.matcher(table.getTablePath().toString())
                                                    .matches())
                            .collect(Collectors.toList());
            if (selectedTables.isEmpty()) {
                throw new IllegalArgumentException(
                        String.format(
                                "Vitess CDC table-pattern '%s' did not match any declared schema table.",
                                tablePattern.get()));
            }
            return selectedTables;
        }

        return declaredTables;
    }

    private <SplitT extends SourceSplit, StateT extends Serializable>
            List<CatalogTable> extractCheckpointTables(
                    ChangeStreamTableSourceState<StateT, SplitT> state) {
        if (state == null || state.getSplits() == null) {
            return Collections.emptyList();
        }
        for (List<SplitT> splitGroup : state.getSplits()) {
            if (splitGroup == null) {

View on GitHub (pinned to cf67b549a7)