{"record":{"id":"8974e78dbe97bb00","repo":"apache/beam","slug":"no-generator-found-for-field","errorCode":null,"errorMessage":"No generator found for field: ","messagePattern":"No generator found for field: ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datagen/DataGeneratorRowFn.java","lineNumber":73,"sourceCode":"    this.fieldGenerators = new HashMap<>();\n\n    for (Schema.Field field : schema.getFields()) {\n      fieldGenerators.put(field.getName(), createGeneratorForField(field));\n    }\n  }\n\n  @ProcessElement\n  public void processElement(\n      @Element Long index, @Timestamp Instant timestamp, OutputReceiver<Row> out) {\n    Row.Builder rowBuilder = Row.withSchema(schema);\n    for (Schema.Field field : schema.getFields()) {\n      Object value;\n      if (field.getName().equals(this.primaryTimestampField)) {\n        value = timestamp.toDateTime();\n      } else {\n        FieldGenerator generator = fieldGenerators.get(field.getName());\n        if (generator == null) {\n          throw new IllegalStateException(\"No generator found for field: \" + field.getName());\n        }\n        value = generator.generate(index);\n      }\n      rowBuilder.addValue(value);\n    }\n    out.output(rowBuilder.build());\n  }\n\n  @FunctionalInterface\n  private interface FieldGenerator extends Serializable {\n    @Nullable\n    Object generate(long index);\n  }\n\n  private FieldGenerator createGeneratorForField(Schema.Field field) {\n    String fieldName = field.getName();\n    FieldGenerator valueGenerator = createValueGeneratorForField(field);\n    double nullRate = properties.path(\"fields.\" + fieldName + \".null-rate\").asDouble(0.0);","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datagen/DataGeneratorRowFn.java#L55-L91","documentation":"During element generation, DataGeneratorRowFn iterates every schema field and looks up a prebuilt FieldGenerator by name. If a field has no entry in the fieldGenerators map, the internal invariant that every schema field got a generator has been broken, so an IllegalStateException is thrown.","triggerScenarios":"A schema field that is neither the primary timestamp field nor covered by the generators built in the constructor; typically caused by generator construction skipping certain field types or configuration shapes so the map has fewer entries than schema fields.","commonSituations":"Running a datagen table whose schema contains a field type that valueGenerator could not map, while the earlier creation path silently skipped it; schema mutated after the row function was built.","solutions":["Ensure every field in the table schema maps to a supported generator (check field types).","Configure per-field generation via 'fields.<name>.kind' properties so the builder creates a generator for the field.","Check for a library bug: the field-creation loop and the generation loop disagree; report/upgrade Beam version."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"Set<String> schemaFields = schema.getFieldNames().stream().collect(Collectors.toSet());\nif (!schemaFields.equals(fieldGenerators.keySet())) {\n  throw new IllegalStateException(\"Missing generators for: \" + Sets.difference(schemaFields, fieldGenerators.keySet()));\n}","typeGuard":null,"tryCatchPattern":"try { pipeline.run().waitUntilFinish(); } catch (IllegalStateException e) { /* inspect schema vs configured generators */ }","preventionTips":["Keep all schema fields on supported scalar types.","Configure explicit fields.* generator properties for every non-default field."],"tags":["beam-sql","datagen","internal-state"],"backgroundTag":"internal-invariant-violation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}