{"record":{"id":"2b14e88c52ebfa48","repo":"apache/seatunnel","slug":"tableexists-tablepath-error","errorCode":null,"errorMessage":"tableExists${tablePath} error","messagePattern":"tableExists(.+?) error","errorType":"exception","errorClass":"org.apache.seatunnel.api.table.catalog.exception.CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/catalog/MaxComputeCatalog.java","lineNumber":137,"sourceCode":"        Odps odps = getOdps(databaseName);\n\n        Tables tables = odps.tables();\n        List<String> tableNames = new ArrayList<>();\n        tables.forEach(\n                table -> {\n                    tableNames.add(table.getName());\n                });\n        return tableNames;\n    }\n\n    @Override\n    public boolean tableExists(TablePath tablePath) throws CatalogException {\n        try {\n            Odps odps = getOdps(tablePath.getDatabaseName(), tablePath.getSchemaName());\n            com.aliyun.odps.Tables tables = odps.tables();\n            return tables.exists(tablePath.getTableName());\n        } catch (OdpsException e) {\n            throw new CatalogException(\"tableExists\" + tablePath + \" error\", e);\n        }\n    }\n\n    @Override\n    public CatalogTable getTable(TablePath tablePath)\n            throws CatalogException, TableNotExistException {\n        return getTable(tablePath, new ArrayList<>());\n    }\n\n    @Override\n    public CatalogTable getTable(TablePath tablePath, List<String> fieldNames)\n            throws CatalogException, TableNotExistException {\n        if (!tableExists(tablePath)) {\n            throw new TableNotExistException(catalogName, tablePath);\n        }\n        Table odpsTable;\n        com.aliyun.odps.TableSchema odpsSchema;\n        try {","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/catalog/MaxComputeCatalog.java#L119-L155","documentation":"MaxComputeCatalog.tableExists wraps OdpsException from odps.tables().exists(tableName) into a CatalogException with this message. The check itself failed (SDK/network/auth error) — this does not mean the table is absent; a normal 'not exists' returns false without throwing.","triggerScenarios":"getTable calls tableExists(tablePath) before fetching metadata; the SDK existence check throws OdpsException due to connectivity, auth, or invalid database/schema/project resolution.","commonSituations":"Database name in TablePath does not match any project; wrong endpoint; revoked read permissions on the table's project; transient network failures during job startup.","solutions":["Check the cause OdpsException for status code/message","Validate the TablePath database/schema/tableName against the MaxCompute console","Verify credentials and endpoint configuration","Retry on transient network errors; fix permissions if 403/authorization errors"],"exampleFix":"// before\nTablePath path = TablePath.of(\"wrong_db\", \"my_table\");\ncatalog.tableExists(path); // OdpsException wrapped\n// after\nTablePath path = TablePath.of(\"my_proj\", \"my_table\");\nif (catalog.tableExists(path)) {\n    catalog.getTable(path);\n}","handlingStrategy":"try-catch","validationCode":"// pre-check identifiers before catalog calls\nif (tablePath.getDatabaseName() == null || tablePath.getTableName() == null) {\n    throw new IllegalArgumentException(\"tablePath must include database and table\");\n}\nif (!tablePath.getDatabaseName().matches(\"[a-zA-Z_][a-zA-Z0-9_]*\")) {\n    throw new IllegalArgumentException(\"Invalid MaxCompute project name: \" + tablePath.getDatabaseName());\n}","typeGuard":null,"tryCatchPattern":"try {\n    if (catalog.tableExists(tablePath)) {\n        return catalog.getTable(tablePath);\n    }\n} catch (CatalogException e) {\n    if (e.getCause() instanceof OdpsException\n            && ((OdpsException) e.getCause()).getErrorCode() != null\n            && ((OdpsException) e.getCause()).getErrorCode().contains(\"NoSuchObject\")) {\n        return null; // treat as absent\n    }\n    throw e;\n}","preventionTips":["Confirm database/table names against the MaxCompute console before the job","Use fully qualified TablePath (project.table) consistently","Check OdpsException error codes to distinguish auth vs not-found vs network","Add retries with backoff for transient SDK/network failures"],"tags":["maxcompute","catalog","odps","table-existence"],"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-14T11:17:12.474Z"}