{"record":{"id":"461a903e4b1dcddd","repo":"apache/seatunnel","slug":"field-not-in-table","errorCode":"FIELD_NOT_IN_TABLE","errorMessage":"Field \" + field + \" does not exist in table \" + pluginConfig.get(TABLE)","messagePattern":"Field \" \\+ field \\+ \" does not exist in table \" \\+ pluginConfig\\.get\\(TABLE\\)","errorType":"error_code","errorClass":"CassandraConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cassandra/src/main/java/org/apache/seatunnel/connectors/seatunnel/cassandra/sink/CassandraSink.java","lineNumber":75,"sourceCode":"                CassandraClient.getCqlSessionBuilder(\n                                cassandraParameters.getHost(),\n                                cassandraParameters.getKeyspace(),\n                                cassandraParameters.getUsername(),\n                                cassandraParameters.getPassword(),\n                                cassandraParameters.getDatacenter())\n                        .build()) {\n            List<String> fields = cassandraParameters.getFields();\n            this.tableSchema = CassandraClient.getTableSchema(session, pluginConfig.get(TABLE));\n            if (fields == null || fields.isEmpty()) {\n                List<String> newFields = new ArrayList<>();\n                for (int i = 0; i < tableSchema.size(); i++) {\n                    newFields.add(tableSchema.get(i).getName().asInternal());\n                }\n                this.cassandraParameters.setFields(newFields);\n            } else {\n                for (String field : fields) {\n                    if (!tableSchema.contains(field)) {\n                        throw new CassandraConnectorException(\n                                CassandraConnectorErrorCode.FIELD_NOT_IN_TABLE,\n                                \"Field \"\n                                        + field\n                                        + \" does not exist in table \"\n                                        + pluginConfig.get(TABLE));\n                    }\n                }\n            }\n        } catch (Exception e) {\n            throw new CassandraConnectorException(\n                    SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED,\n                    String.format(\n                            \"PluginName: %s, PluginType: %s, Message: %s\",\n                            getPluginName(), PluginType.SINK, ExceptionUtils.getMessage(e)));\n        }\n    }\n\n    @Override","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cassandra/src/main/java/org/apache/seatunnel/connectors/seatunnel/cassandra/sink/CassandraSink.java#L57-L93","documentation":"CassandraSink validates each user-configured field against the live table schema (ColumnDefinitions.contains(field)); if a configured field is not a real column, it throws FIELD_NOT_IN_TABLE naming the field and table. This fails fast before any writes are attempted, since CQL inserts would fail anyway.","triggerScenarios":"In the CassandraSink constructor, a name in the `fields` config list is not found in the table's ColumnDefinitions obtained from CassandraClient.getTableSchema.","commonSituations":"Typo or wrong case in a column name (Cassandra identifiers are case-sensitive when quoted); schema changed since config was written (column renamed/dropped); fields list referencing columns from a different table/keyspace.","solutions":["Fix the field name in the sink `fields` config to exactly match the table column (run `DESCRIBE TABLE` to copy exact names).","Remember unquoted identifiers are lowercased by Cassandra; if the column was created quoted with capitals, quote it identically in config.","If the schema changed, update the config or re-add the missing column via ALTER TABLE.","Ensure the config's table (and keyspace) is the one you intend — a wrong keyspace makes valid columns look nonexistent."],"exampleFix":"// before\nfields = [\"Id\", \"Name\"]\n// after (unquoted Cassandra columns are lowercase)\nfields = [\"id\", \"name\"]","handlingStrategy":"validation","validationCode":"// compare config fields against live schema before deploying\ncqlsh -e \"DESCRIBE TABLE ${KEYSPACE}.${TABLE}\" | grep -E '\\| *(${FIELD1}|${FIELD2}) *\\|'","typeGuard":null,"tryCatchPattern":"// fail fast with field name in message\ntry {\n    sink.validate(cfg);\n} catch (CassandraConnectorException e) {\n    if (CassandraConnectorErrorCode.FIELD_NOT_IN_TABLE.equals(e.getErrorCode())) {\n        throw new IllegalArgumentException(\"Fix fields config: \" + e.getMessage());\n    } throw e;\n}","preventionTips":["Copy column names verbatim from DESCRIBE TABLE output.","Remember unquoted Cassandra identifiers are lowercase.","Re-validate configs after any ALTER TABLE / schema migration."],"tags":["cassandra","schema","validation","configuration"],"backgroundTag":"schema-validation-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"}