apache/seatunnel · error · SQLException

Column ${column} not found in table ${schemaAndTableName}

Error message

Column ${column} not found in table ${schemaAndTableName}

What it means

columnIsNullable() queries YashanDB metadata (all_tab_columns-style) for a column's NULLABLE flag. If the ResultSet is empty the column does not exist in the given schema.table, so it throws SQLException instead of returning a nullability value.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/yashandb/YashanDbDialect.java:500

        return String.format(
                "COMMENT ON COLUMN %s.%s IS '%s'",
                tableIdentifier(tablePath), quoteIdentifier(column.getName()), column.getComment());
    }

    private boolean columnIsNullable(Connection connection, TablePath tablePath, String column)
            throws SQLException {
        String selectColumnSQL =
                "SELECT NULLABLE FROM ALL_TAB_COLUMNS c"
                        + " WHERE c.owner = ? AND c.table_name = ? AND c.column_name = ?";
        try (PreparedStatement ps = connection.prepareStatement(selectColumnSQL)) {
            ps.setString(1, tablePath.getSchemaName());
            ps.setString(2, tablePath.getTableName());
            ps.setString(3, column);
            try (ResultSet rs = ps.executeQuery()) {
                if (rs.next()) {
                    return "Y".equals(rs.getString("NULLABLE"));
                }
                throw new SQLException(
                        String.format(
                                "Column %s not found in table %s",
                                column, tablePath.getSchemaAndTableName()));
            }
        }
    }

    @Override
    public String dualTable() {
        return " FROM dual ";
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Verify the column exists in the target YashanDB table (SELECT from metadata views) with exact-case name
  2. Check that schema and table names in the sink config match the actual YashanDB objects
  3. Ensure identifier casing matches (quote or uppercase the column name as YashanDB stores it)
  4. Pre-create/sync the target table schema so the column exists before schema-evolution events arrive

Example fix

// before
throw new SQLException(String.format("Column %s not found in table %s", column, tablePath.getSchemaAndTableName()));
// after
// ensure column exists first: ALTER TABLE ... ADD COLUMN if missing, or log and return a safe default
throw new SQLException(String.format("Column %s not found in table %s (check identifier case and schema)", column, tablePath.getSchemaAndTableName()));
Defensive patterns

Strategy: validation

Validate before calling

SELECT NULLABLE FROM all_tab_columns WHERE owner=? AND table_name=? AND column_name=?; // must return a row before schema evolution

Try / catch

try {
    nullable = columnIsNullable(conn, tablePath, column);
} catch (SQLException e) {
    if (e.getMessage().contains("not found")) { ensureColumnExists(conn, tablePath, column); }
    else throw e;
}

Prevention

When it happens

Trigger: targetColumnNullable() -> columnIsNullable(connection, tablePath, column) is called during ALTER TABLE construction while the column name from the CDC event does not exist in the target YashanDB table (case mismatch, missing column, wrong schema/table name).

Common situations: Schema evolution applied to the wrong target table; target table created with different column casing (YashanDB stores uppercase identifiers); CDC event referencing a column that was manually dropped from the target table.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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