apache/seatunnel · error · SQLException
Failed to process regex table path:
Error message
Failed to process regex table path:
What it means
When a table_path contains a regex pattern, processRegexTablePath lists catalog tables via JDBC metadata and filters them against the pattern. Any exception during listing/matching (metadata query failure, malformed pattern, connection problems) is caught, logged as a warning, and rethrown as a SQLException 'Failed to process regex table path: <path>'.
Solutions
- Check the logged WARN stack trace (Error processing table path with regex) for the root cause
- Validate the regex independently (compile it in a REPL or regex tool) before putting it in table_path
- Grant the connecting user permission to list tables in the target catalog/schema, and verify the connection is healthy
- If you don't need pattern matching, use an explicit table_path instead
Example fix
// before
table_path = "mydb.log_[2024-(" // unbalanced paren -> PatternSyntaxException
// after
table_path = "mydb.log_2024_[0-9]+" // valid regex Defensive patterns
Strategy: validation
Validate before calling
try {
java.util.regex.Pattern.compile(tablePath); // throws PatternSyntaxException early
} catch (java.util.regex.PatternSyntaxException e) {
throw new IllegalArgumentException("Invalid table_path regex: " + tablePath, e);
}
// also pre-test metadata access:
try (var rs = connection.getMetaData().getTables(catalog, schema, "%", new String[]{"TABLE"})) {
if (!rs.isBeforeFirst()) log.warn("No tables visible to user — check privileges");
} Try / catch
try {
jdbcSource.open(...); // triggers table discovery
} catch (SQLException e) {
if (e.getMessage().startsWith("Failed to process regex table path")) {
log.error("Inspect WARN 'Error processing table path with regex' for root cause", e);
}
} Prevention
- Test regex patterns before using them in table_path
- Grant metadata-listing privileges to the connector user
- Prefer explicit table_path when pattern matching isn't needed
- Keep connections alive during discovery (metadata listing can be slow)
When it happens
Trigger: getTables is called with a regex table path and an inner exception occurs: database metadata call fails (connection dropped, missing privileges), the regex is invalid (PatternSyntaxException), or catalog/schema lookups throw.
Common situations: Typos in regex producing PatternSyntaxException (unbalanced brackets); user lacking metadata-listing privileges on the catalog; transient network failures during metadata retrieval; regex matching zero tables then downstream assumptions failing.
Related errors
- Catalog not found, loading tables from jdbc directly. url
- Column not found in table
- Column ' ' not found in .COLUMNS for table ; assuming NOT…
- DATABASE_NOT_EXISTED
- Error processing table path with regex
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/cdcba5122c917afa.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/utils/JdbcCatalogUtils.java:594
JdbcSourceTable.builder()
.tablePath(path)
.partitionColumn(tableConfig.getPartitionColumn())
.partitionNumber(tableConfig.getPartitionNumber())
.partitionStart(tableConfig.getPartitionStart())
.partitionEnd(tableConfig.getPartitionEnd())
.useSelectCount(tableConfig.getUseSelectCount())
.skipAnalyze(tableConfig.getSkipAnalyze())
.catalogTable(catalogTable)
.build();
result.put(path, jdbcSourceTable);
log.info("Found table matching regex pattern: {}", path);
}
log.info("Found {} tables matching regex pattern: {}", catalogTables.size(), tablePath);
} catch (Exception e) {
log.warn("Error processing table path with regex: {}", tablePath, e);
throw new SQLException("Failed to process regex table path: " + tablePath, e);
}
}
}
View on GitHub (pinned to cf67b549a7)