apache/seatunnel · error · CatalogException

Failed TRUNCATE TABLE in catalog

Error message

Failed TRUNCATE TABLE in catalog %s

What it means

This error is raised by StarRocksCatalog.truncateTable when executing the TRUNCATE TABLE statement against StarRocks fails (unless ignoreIfNotExists suppresses a missing table). It fires when the table cannot be truncated — for example the table does not exist, the user lacks privilege, or the JDBC statement fails — and callers such as testCatalog will see it as a CatalogException wrapping the underlying SQL error.

Solutions

  1. Verify the table exists and the user has TRUNCATE privilege
  2. Check FE connectivity and retry after transient failures
  3. Inspect the wrapped exception for the exact StarRocks error
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/catalog/StarRocksCatalog.java:253 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/2935ca10d3e89033. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/catalog/StarRocksCatalog.java:253

                        StarRocksSaveModeUtil.INSTANCE.getDropTableSql(
                                tablePath, ignoreIfNotExists));
            }
        } catch (Exception e) {
            throw new CatalogException(
                    String.format("Failed listing database in catalog %s", catalogName), e);
        }
    }

    public void truncateTable(TablePath tablePath, boolean ignoreIfNotExists)
            throws TableNotExistException, CatalogException {
        try {
            if (ignoreIfNotExists) {
                try (Statement stmt = conn.createStatement()) {
                    stmt.execute(StarRocksSaveModeUtil.INSTANCE.getTruncateTableSql(tablePath));
                }
            }
        } catch (Exception e) {
            throw new CatalogException(
                    String.format("Failed TRUNCATE TABLE in catalog %s", tablePath.getFullName()),
                    e);
        }
    }

    public void executeSql(TablePath tablePath, String sql) {
        try {
            try (Statement stmt = conn.createStatement()) {
                stmt.execute(sql);
            }
        } catch (Exception e) {
            throw new CatalogException(String.format("Failed EXECUTE SQL in catalog %s", sql), e);
        }
    }

    public boolean isExistsData(TablePath tablePath) {
        String sql = String.format("select * from %s limit 1", tablePath.getFullName());
        try (Statement statement = conn.createStatement();

View on GitHub (pinned to cf67b549a7)