{"record":{"id":"a8bcaa873ecf1956","repo":"apache/seatunnel","slug":"column-column-not-found-in-table-schemaandtab","errorCode":null,"errorMessage":"Column ${column} not found in table ${schemaAndTableName}","messagePattern":"Column (.+?) not found in table (.+?)","errorType":"exception","errorClass":"SQLException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/yashandb/YashanDbDialect.java","lineNumber":500,"sourceCode":"        return String.format(\n                \"COMMENT ON COLUMN %s.%s IS '%s'\",\n                tableIdentifier(tablePath), quoteIdentifier(column.getName()), column.getComment());\n    }\n\n    private boolean columnIsNullable(Connection connection, TablePath tablePath, String column)\n            throws SQLException {\n        String selectColumnSQL =\n                \"SELECT NULLABLE FROM ALL_TAB_COLUMNS c\"\n                        + \" WHERE c.owner = ? AND c.table_name = ? AND c.column_name = ?\";\n        try (PreparedStatement ps = connection.prepareStatement(selectColumnSQL)) {\n            ps.setString(1, tablePath.getSchemaName());\n            ps.setString(2, tablePath.getTableName());\n            ps.setString(3, column);\n            try (ResultSet rs = ps.executeQuery()) {\n                if (rs.next()) {\n                    return \"Y\".equals(rs.getString(\"NULLABLE\"));\n                }\n                throw new SQLException(\n                        String.format(\n                                \"Column %s not found in table %s\",\n                                column, tablePath.getSchemaAndTableName()));\n            }\n        }\n    }\n\n    @Override\n    public String dualTable() {\n        return \" FROM dual \";\n    }\n}\n","sourceCodeStart":482,"sourceCodeEnd":513,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/yashandb/YashanDbDialect.java#L482-L513","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Verify the column exists in the target YashanDB table (SELECT from metadata views) with exact-case name","Check that schema and table names in the sink config match the actual YashanDB objects","Ensure identifier casing matches (quote or uppercase the column name as YashanDB stores it)","Pre-create/sync the target table schema so the column exists before schema-evolution events arrive"],"exampleFix":"// before\nthrow new SQLException(String.format(\"Column %s not found in table %s\", column, tablePath.getSchemaAndTableName()));\n// after\n// ensure column exists first: ALTER TABLE ... ADD COLUMN if missing, or log and return a safe default\nthrow new SQLException(String.format(\"Column %s not found in table %s (check identifier case and schema)\", column, tablePath.getSchemaAndTableName()));","handlingStrategy":"validation","validationCode":"SELECT NULLABLE FROM all_tab_columns WHERE owner=? AND table_name=? AND column_name=?; // must return a row before schema evolution","typeGuard":null,"tryCatchPattern":"try {\n    nullable = columnIsNullable(conn, tablePath, column);\n} catch (SQLException e) {\n    if (e.getMessage().contains(\"not found\")) { ensureColumnExists(conn, tablePath, column); }\n    else throw e;\n}","preventionTips":["Keep target table schema in sync with source before enabling schema evolution","Use consistent identifier casing (YashanDB default uppercase) between CDC events and DDL","Verify schema/table name options in the sink match the physical YashanDB objects"],"tags":["jdbc","yashandb","metadata","sql"],"backgroundTag":"entity-not-found","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"}