{"record":{"id":"19cf142cc0a746d9","repo":"apache/seatunnel","slug":"failed-getting-table-tablepath-getfullname","errorCode":null,"errorMessage":"Failed getting table {tablePath.getFullName()}","messagePattern":"Failed getting table (.+?)","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/AbstractJdbcCatalog.java","lineNumber":252,"sourceCode":"            TableSchema.Builder tableSchemaBuilder =\n                    buildColumnsReturnTablaSchemaBuilder(tablePath, conn);\n            // add primary key\n            primaryKey.ifPresent(tableSchemaBuilder::primaryKey);\n            // add constraint key\n            constraintKeys.forEach(tableSchemaBuilder::constraintKey);\n            TableIdentifier tableIdentifier = getTableIdentifier(tablePath);\n            return CatalogTable.of(\n                    tableIdentifier,\n                    tableSchemaBuilder.build(),\n                    buildConnectorOptions(tablePath),\n                    getPartitionKeys(conn, tablePath),\n                    comment.orElse(\"\"),\n                    catalogName);\n\n        } catch (SeaTunnelRuntimeException e) {\n            throw e;\n        } catch (Exception e) {\n            throw new CatalogException(\n                    String.format(\"Failed getting table %s\", tablePath.getFullName()), e);\n        }\n    }\n\n    protected TableSchema.Builder buildColumnsReturnTablaSchemaBuilder(\n            TablePath tablePath, Connection conn) throws SQLException {\n        TableSchema.Builder columnsBuilder = TableSchema.builder();\n        try (PreparedStatement ps = conn.prepareStatement(getSelectColumnsSql(tablePath));\n                ResultSet resultSet = ps.executeQuery()) {\n            buildColumnsWithErrorCheck(tablePath, resultSet, columnsBuilder);\n        }\n        return columnsBuilder;\n    }\n\n    protected List<String> getPartitionKeys(Connection connection, TablePath tablePath)\n            throws SQLException {\n        return Collections.emptyList();\n    }","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/AbstractJdbcCatalog.java#L234-L270","documentation":"After the existence check passes, AbstractJdbcCatalog.getTable() reads metadata (columns, PKs, constraints, comment) and wraps any unexpected Exception into CatalogException('Failed getting table <name>'). SeaTunnelRuntimeExceptions are rethrown as-is so typed errors propagate unchanged.","triggerScenarios":"getTable(tablePath) metadata reading code (connection queries for columns/keys/comments via buildColumnsReturnTablaSchemaBuilder and related helpers) throws a non-SeaTunnelRuntimeException exception; called from getCatalogTable/tableOfQuery.","commonSituations":"Dialect-specific metadata SQL not supported by the server version; permission denied on information_schema/system catalogs; connection dropped mid-metadata-read; unsupported table types (views, system tables); driver quirks returning unexpected result shapes.","solutions":["Inspect the wrapped cause for the exact failing metadata query and fix it (usually SQL/permission).","Grant the catalog user access to information_schema / metadata tables.","Check DB server version support vs the connector dialect implementation.","Retry if the connection was transiently dropped; ensure getConnection pool is healthy.","Exclude unsupported objects (system tables/views) from the sync config."],"exampleFix":"// before\nSELECT * FROM information_schema.columns WHERE table_name = 'orders'\n-- missing schema filter\n// after\nSELECT * FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'orders'","handlingStrategy":"try-catch","validationCode":"// pre-check permissions\ntry (Connection c = DriverManager.getConnection(url, user, pass); Statement s = c.createStatement()) { s.executeQuery(\"SELECT * FROM information_schema.columns LIMIT 1\"); }","typeGuard":null,"tryCatchPattern":"catch (CatalogException e) { log.error(\"getTable failed for table: {}\", e.getMessage(), e.getCause()); /* inspect cause: SQL syntax, permissions, or driver issue */ }","preventionTips":["Grant catalog user metadata access (information_schema)","Confirm DB server version is supported by the dialect","Exclude views/system tables from catalog reads","Keep JDBC driver current"],"tags":["jdbc","catalog","metadata","table-read"],"backgroundTag":"database-query-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}