{"record":{"id":"6078ae702881e5bc","repo":"apache/seatunnel","slug":"get-hive-table-information-failed-6078ae","errorCode":"GET_HIVE_TABLE_INFORMATION_FAILED","errorMessage":"Failed to get table ${dbName}.${tableName}","messagePattern":"Failed to get table (.+?)\\.(.+?)","errorType":"error_code","errorClass":"HiveConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveMetaStoreCatalog.java","lineNumber":446,"sourceCode":"    }\n\n    private static String getFirstMetastoreUri(@NonNull String metastoreUri) {\n        String[] uris = metastoreUri.split(\",\");\n        for (String uri : uris) {\n            String trimmed = uri.trim();\n            if (!trimmed.isEmpty()) {\n                return trimmed;\n            }\n        }\n        return \"\";\n    }\n\n    public Table getTable(@NonNull String dbName, @NonNull String tableName) {\n        try {\n            return getClient().getTable(dbName, tableName);\n        } catch (TException e) {\n            String msg = String.format(\"Failed to get table %s.%s\", dbName, tableName);\n            throw new HiveConnectorException(\n                    HiveConnectorErrorCode.GET_HIVE_TABLE_INFORMATION_FAILED, msg, e);\n        }\n    }\n\n    public void createDatabaseIfNotExists(String db) throws TException {\n        try {\n            try {\n                getClient().getDatabase(db);\n                log.debug(\"Database {} already exists\", db);\n                return;\n            } catch (org.apache.hadoop.hive.metastore.api.NoSuchObjectException ignored) {\n            }\n            Database database = new Database();\n            database.setName(db);\n            log.info(\"Creating database {}\", db);\n            getClient().createDatabase(database);\n        } catch (org.apache.hadoop.hive.metastore.api.AlreadyExistsException e) {\n            log.debug(\"Database {} already exists (race)\", db);","sourceCodeStart":428,"sourceCodeEnd":464,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveMetaStoreCatalog.java#L428-L464","documentation":"HiveConnectorException (code GET_HIVE_TABLE_INFORMATION_FAILED) thrown by HiveMetaStoreCatalog.getTable when the metastore Thrift call getTable(dbName, tableName) fails with a TException. It wraps the underlying client error (connection problem, metastore outage, or an actual missing table surfaced as TException) with the db and table context.","triggerScenarios":"Calling getTable (or its caller hiveTable) with a database/table that does not exist (NoSuchObjectException), an unreachable metastore URI, thrift timeout, or authentication failure against the Hive metastore.","commonSituations":"Typo in table name or database name in the job config; metastore service down or moved; Kerberos/SASL misconfiguration; network partition between SeaTunnel worker and metastore.","solutions":["Confirm the database and table names exist: run 'SHOW TABLES' / 'DESCRIBE' in Hive or check via beeline.","Verify hive metastore uris in the config point to a reachable metastore (test with telnet/nc on the thrift port, default 9083).","Inspect the chained TException cause for NoSuchObjectException vs connection/timeout errors and fix accordingly.","Check Kerberos/keytab or metastore authentication settings if the cause indicates SASL/authentication failure."],"exampleFix":"// before: reading a table that does not exist\n// table = catalog.getTable(\"default\", \"user_events\")\n\n// after: guard with tableExists first\nif (catalog.tableExists(\"default\", \"user_events\")) {\n    Table table = catalog.getTable(\"default\", \"user_events\");\n} else {\n    throw new IllegalArgumentException(\"Table default.user_events does not exist\");\n}","handlingStrategy":"validation","validationCode":"if (!catalog.tableExists(dbName, tableName)) {\n    throw new IllegalArgumentException(dbName + \".\" + tableName + \" does not exist\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    Table t = catalog.getTable(dbName, tableName);\n} catch (HiveConnectorException e) {\n    // inspect e.getCause(): NoSuchObjectException => missing table; connection errors => metastore issue\n    log.error(\"Metastore getTable failed for {}.{}: {}\", dbName, tableName, e.getCause());\n}","preventionTips":["Validate db/table names against the metastore before job submission","Monitor metastore availability; keep metastore.uris accurate","Refresh Kerberos credentials for long-running jobs"],"tags":["hive","metastore","thrift","table"],"backgroundTag":"resource-not-found","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"}