{"record":{"id":"1d80fdb06413f10e","repo":"apache/beam","slug":"not-a-primitive-type-for-field-name-s-s","errorCode":null,"errorMessage":"Not a primitive type for field name %s: %s","messagePattern":"Not a primitive type for field name (.+?): (.+?)","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/values/RowUtils.java","lineNumber":208,"sourceCode":"          break;\n        case DECIMAL:\n          processedValue = cases.processDecimal(rowPosition, (BigDecimal) value, this);\n          break;\n        case FLOAT:\n          processedValue = cases.processFloat(rowPosition, (Float) value, this);\n          break;\n        case DOUBLE:\n          processedValue = cases.processDouble(rowPosition, (Double) value, this);\n          break;\n        case STRING:\n          processedValue = cases.processString(rowPosition, (String) value, this);\n          break;\n        case BOOLEAN:\n          processedValue = cases.processBoolean(rowPosition, (Boolean) value, this);\n          break;\n        default:\n          // Shouldn't actually get here, but we need this case to satisfy linters.\n          throw new IllegalArgumentException(\n              String.format(\n                  \"Not a primitive type for field name %s: %s\", rowPosition.descriptor, fieldType));\n      }\n      if (processedValue == null) {\n        if (!fieldType.getNullable()) {\n          throw new IllegalArgumentException(\n              String.format(\"%s is not nullable in  field %s\", fieldType, rowPosition.descriptor));\n        }\n      }\n      return processedValue;\n    }\n  }\n\n  static class FieldOverride {\n    FieldOverride(Object overrideValue) {\n      this.overrideValue = overrideValue;\n    }\n","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/values/RowUtils.java#L190-L226","documentation":"RowUtils' row/iterable matching walker hits a Schema field whose type is not one of the primitive cases it handles (BYTE, INT16, INT32, INT64, FLOAT, DOUBLE, STRING, BOOLEAN, DATETIME, INSTANT, DECIMAL, BYTES). The default branch is a defensive catch-all: the switch should already have dispatched every primitive, so this means the value produced a processed value only via a path that fell through, i.e. the field's SchemaType was not matched anywhere. It signals an internal type-dispatch failure while validating/capturing a Row's field values.","triggerScenarios":"Calling RowUtils.attachSchema or Row.withSchema-style matching (via processRow/capturedElement/processMap) on a Row whose field has a Schema.TypeName not handled by the switch — typically a LOGICAL_TYPE or newly added type, or a nested container type that reached the leaf matcher instead of the array/map branch.","commonSituations":"Using a custom logical type (e.g. Joda/Java-time wrappers) or a portable logical type in a schema and then serializing/comparing rows; running code written for an older Beam version against a schema containing types the switch did not know; building rows with mismatched Schema objects where a container type is misdeclared as a leaf.","solutions":["Check the field's Schema.FieldType; ensure container fields (ARRAY/ITERABLE/MAP) are declared as such so they dispatch to processArray/processMap rather than the primitive switch","For LOGICAL_TYPE fields, register the logical type and ensure its base type is a primitive the switch supports","Verify the Beam SDK version supports the type in question; upgrade or replace unsupported field types","If it seems like an internal bug, file/report to Beam with the schema; the comment says this branch 'shouldn't actually get here'"],"exampleFix":"// before (schema field misdeclared)\nSchema.Field.of(\"tags\", Schema.FieldType.STRING) // values are actually a list\n// after\nSchema.Field.of(\"tags\", Schema.FieldType.array(Schema.FieldType.STRING))","handlingStrategy":"validation","validationCode":"Schema.FieldType ft = schema.getField(name).getType();\nif (!ft.getTypeName().isPrimitiveType() && !ft.getTypeName().equals(Schema.TypeName.LOGICAL_TYPE)) {\n  throw new IllegalArgumentException(\"Unhandled field type for \" + name + \": \" + ft);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Declare container fields (arrays/maps) with FieldType.array/map so they dispatch correctly","Ensure logical types are registered and backed by a supported primitive","Keep Beam SDK versions consistent across the pipeline"],"tags":["java","apache-beam","schema","row"],"backgroundTag":"schema-validation-failed","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}