{"record":{"id":"69578b16b7e6f9b6","repo":"apache/seatunnel","slug":"no-hive-tables-matched-the-regex-pattern-please-c","errorCode":null,"errorMessage":"No hive tables matched the regex pattern. Please check `table_name` and `use_regex`. table_name=${tableNamePattern}","messagePattern":"No hive tables matched the regex pattern\\. Please check `table_name` and `use_regex`\\. table_name=(.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/source/config/MultipleTableHiveSourceConfig.java","lineNumber":103,"sourceCode":"        }\n\n        String tableNamePattern =\n                tableConfig\n                        .getOptional(HiveSourceOptions.TABLE_NAME)\n                        .orElse(\"<missing table_name>\");\n        if (!tableConfig.getOptional(HiveSourceOptions.METASTORE_URI).isPresent()\n                || StringUtils.isBlank(tableConfig.get(HiveSourceOptions.METASTORE_URI))) {\n            throw new IllegalArgumentException(\n                    \"Hive metastore_uri is required for regex table discovery (use_regex). table_name=\"\n                            + tableNamePattern);\n        }\n\n        try (HiveMetaStoreCatalog catalog = HiveMetaStoreCatalog.create(tableConfig)) {\n            catalog.open();\n            List<TablePath> tablePaths =\n                    HiveSourceTableDiscovery.discoverTablePaths(tableConfig, catalog);\n            if (tablePaths.isEmpty()) {\n                throw new IllegalArgumentException(\n                        \"No hive tables matched the regex pattern. Please check `table_name` and `use_regex`. table_name=\"\n                                + tableNamePattern);\n            }\n            logMatchedTables(tableNamePattern, tablePaths);\n            return tablePaths.stream()\n                    .map(path -> overrideTableName(tableConfig, path.getFullName()))\n                    .collect(Collectors.toList());\n        }\n    }\n\n    private void logMatchedTables(String tableNamePattern, List<TablePath> tablePaths) {\n        String matchedTables =\n                tablePaths.stream().map(TablePath::getFullName).collect(Collectors.joining(\", \"));\n        log.info(\n                \"Hive regex discovery matched {} table(s) for table_name='{}': {}\",\n                tablePaths.size(),\n                tableNamePattern,\n                matchedTables);","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/source/config/MultipleTableHiveSourceConfig.java#L85-L121","documentation":"After querying the metastore with the compiled regex patterns, discovery expects at least one matching table. An empty result means either the pattern matched nothing or the database/table names differ from what the user assumed, so the connector fails fast with this error instead of producing a job that reads zero tables. The configured `table_name` is echoed to aid debugging.","triggerScenarios":"discoverTablePaths returns an empty list inside expandTableConfigIfNeeded — the compiled database/table regex matched no tables in the metastore reachable via metastore_uri.","commonSituations":"Typo in database or table regex; case sensitivity mismatch (Hive lowercases identifiers); regex anchors wrongly applied (e.g. pattern built for full-match vs find); metastore_uri points to a different cluster than expected; tables exist but pattern uses glob syntax instead of regex.","solutions":["Print/inspect available databases and tables in the metastore and adjust `table_name` regex to match real names","Test the regex against actual table names (mind Java regex semantics and case sensitivity)","Verify metastore_uri points to the intended cluster so discovery queries the right metastore","Simplify the pattern to \"db.\\\\.*\" first, then narrow it down step by step"],"exampleFix":"// before\ntable_name = \"Db1.USER_.*\" // wrong case, matches nothing\n\n// after\ntable_name = \"db1.user_table_.*\" // match lowercased Hive identifiers","handlingStrategy":"validation","validationCode":"// Pre-check pattern against metastore before submitting the job\ntry (HiveMetaStoreCatalog catalog = HiveMetaStoreCatalog.create(tableConfig)) {\n    catalog.open();\n    if (HiveSourceTableDiscovery.discoverTablePaths(tableConfig, catalog).isEmpty()) {\n        throw new IllegalStateException(\"Pattern matches no tables: \" + tableNamePattern);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    // submit job\n} catch (IllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"No hive tables matched\")) {\n        // inspect metastore names, adjust table_name regex, resubmit\n    }\n}","preventionTips":["Verify db/table names and casing in the metastore first","Start with a broad pattern db.\\\\.* then narrow","Confirm metastore_uri points to the right cluster"],"tags":["hive","regex","metastore","no-match"],"backgroundTag":"empty-result-set","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}