{"record":{"id":"06ab48a69bb9d3e2","repo":"apache/cassandra","slug":"field-s-doesn-t-exist-in-type-s-s-06ab48","errorCode":null,"errorMessage":"Field '%s' doesn't exist in type '%s.%s'","messagePattern":"Field '(.+?)' doesn't exist in type '(.+?)\\.(.+?)'","errorType":"validation","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/cql3/statements/schema/SchemaDescriptionStatement.java","lineNumber":114,"sourceCode":"    protected UserType validateAndGetType(Keyspaces schema, String typeName)\n    {\n        KeyspaceMetadata keyspaceMetadata = validateAndGetKeyspace(schema);\n\n        UserType type = keyspaceMetadata.types.getNullable(bytes(typeName));\n        if (null == type)\n            throw ire(\"Type '%s.%s' doesn't exist\", keyspaceName, typeName);\n\n        return type;\n    }\n\n    protected UserType validateAndGetTypeField(Keyspaces schema,\n                                               String typeName,\n                                               FieldIdentifier fieldName)\n    {\n        UserType type = validateAndGetType(schema, typeName);\n\n        if (type.fieldPosition(fieldName) == -1)\n            throw ire(\"Field '%s' doesn't exist in type '%s.%s'\", fieldName, keyspaceName, typeName);\n\n        return type;\n    }\n\n    protected String effectiveDescription()\n    {\n        return description == null ? NO_DESCRIPTION : description;\n    }\n\n    protected void providerWarning(String provider)\n    {\n        if (provider != null)\n            ClientWarn.instance.warn(\"Provider functionality not implemented.\" +\n                                     \" Provider '\" + provider + \"' will not be loaded or invoked.\");\n    }\n\n    protected enum DescriptionType\n    {","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/statements/schema/SchemaDescriptionStatement.java#L96-L132","documentation":"validateAndGetTypeField checks that a named field exists within a user-defined type by calling type.fieldPosition(fieldName). A return value of -1 means the UDT has no such field, so the statement is rejected with this InvalidRequestException.","triggerScenarios":"Issuing a statement that targets a specific field of a UDT (e.g. security labels on a type field) where the field name does not match any field of the resolved UserType.","commonSituations":"Typos or wrong casing in field identifiers; UDT was altered and the field renamed/removed; assuming fields from a different UDT in the same keyspace.","solutions":["Verify the field list: SELECT field_names FROM system_schema.types WHERE keyspace_name='<ks>' AND type_name='<type>';","Correct the field identifier spelling/case to match the UDT definition.","Add the missing field via ALTER TYPE <ks>.<type> ADD <field> <ctype>; if it is genuinely needed."],"exampleFix":"// before\nALTER ... FIELD emial ... (on type customer_type)\n// after\nALTER ... FIELD email ...","handlingStrategy":"validation","validationCode":"SELECT field_names FROM system_schema.types WHERE keyspace_name='myks' AND type_name='mytype'; // verify field is present before targeting it","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Mirror UDT field names as constants in application code instead of free-form strings.","Re-check scripts after ALTER TYPE ... RENAME/ADD changes."],"tags":["cql","schema","user-defined-type"],"backgroundTag":"schema-validation-failed","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}