{"record":{"id":"bad74d4d08d5793c","repo":"apache/seatunnel","slug":"hive-metastore-uri-is-required-for-regex-table-dis","errorCode":null,"errorMessage":"Hive metastore_uri is required for regex table discovery (use_regex). table_name=${tableNamePattern}","messagePattern":"Hive metastore_uri is required for regex table discovery \\(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":93,"sourceCode":"    }\n\n    private void parseFromLocalFileSourceByDiscovery(ReadonlyConfig readonlyConfig) {\n        List<ReadonlyConfig> expanded = expandTableConfigIfNeeded(readonlyConfig);\n        this.hiveSourceConfigs = buildHiveSourceConfigs(expanded);\n    }\n\n    private List<ReadonlyConfig> expandTableConfigIfNeeded(ReadonlyConfig tableConfig) {\n        if (!HiveSourceTableDiscovery.isEnabled(tableConfig)) {\n            return Lists.newArrayList(tableConfig);\n        }\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        }","sourceCodeStart":75,"sourceCodeEnd":111,"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#L75-L111","documentation":"Regex table discovery (use_regex) is metastore-backed: the connector must connect to Hive to enumerate which tables match the pattern. expandTableConfigIfNeeded therefore requires a non-blank `metastore_uri` in the table config and throws this error when it is missing or blank, embedding the `table_name` pattern in the message.","triggerScenarios":"MultipleTableHiveSourceConfig.expandTableConfigIfNeeded processes a table config with use_regex=true where HiveSourceOptions.METASTORE_URI is absent or its value is blank.","commonSituations":"Local/HDFS-only Hive configs that never needed metastore_uri now enable use_regex; kerberos/remote metastore migration drops the URI; template config leaves metastore_uri empty.","solutions":["Add `metastore_uri = \"thrift://<metastore-host>:9083\"` to the Hive source config","Verify the value is non-blank after variable substitution in templated configs","If the metastore is truly unavailable, use explicit `table_name`-style plain table configs without use_regex"],"exampleFix":"// before\nuse_regex = true\ntable_name = \"db0.\\\\.*\"\n\n// after\nuse_regex = true\ntable_name = \"db0.\\\\.*\"\nmetastore_uri = \"thrift://metastore-host:9083\"","handlingStrategy":"validation","validationCode":"if (config.get(HiveSourceOptions.USE_REGEX)\n        && !config.getOptional(HiveSourceOptions.METASTORE_URI).map(u -> !u.trim().isEmpty()).orElse(false)) {\n    throw new IllegalArgumentException(\"metastore_uri is required when use_regex=true\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set metastore_uri (e.g. thrift://host:9083) with regex discovery","Verify templated URIs after substitution","Test metastore connectivity before job submission"],"tags":["hive","config","metastore","missing-option"],"backgroundTag":"missing-required-config-field","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"}