{"record":{"id":"58f83ba7436afbd4","repo":"apache/beam","slug":"for-event-time-behavior-event-time-timestamp-column-must-be","errorCode":null,"errorMessage":"For 'event-time' behavior, 'event-time.timestamp-column' must be specified.","messagePattern":"For 'event-time' behavior, 'event-time\\.timestamp-column' must be specified\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datagen/DataGeneratorPTransform.java","lineNumber":65,"sourceCode":"\n    if (!rpsNode.isMissingNode()) {\n      generator = GenerateSequence.from(0).withRate(rpsNode.asLong(), Duration.standardSeconds(1));\n    } else if (!numRowsNode.isMissingNode()) {\n      generator = GenerateSequence.from(0).to(numRowsNode.asLong());\n    } else {\n      throw new IllegalArgumentException(\n          \"A 'datagen' table requires either 'rows-per-second' (for unbounded) or \"\n              + \"'number-of-rows' (for bounded) in TBLPROPERTIES.\");\n    }\n\n    String behavior = properties.path(\"timestamp.behavior\").asText(\"processing-time\");\n    @Nullable String eventTimeColumn = null;\n\n    if (\"event-time\".equalsIgnoreCase(behavior)) {\n      JsonNode columnNode = properties.path(\"event-time.timestamp-column\");\n\n      if (columnNode.isMissingNode() || columnNode.isNull()) {\n        throw new IllegalArgumentException(\n            \"For 'event-time' behavior, 'event-time.timestamp-column' must be specified.\");\n      }\n      eventTimeColumn = columnNode.asText();\n\n      // Validate that the specified column exists and is of type TIMESTAMP.\n      if (!schema.hasField(eventTimeColumn)) {\n        throw new IllegalArgumentException(\n            String.format(\n                \"The specified 'event-time.timestamp-column' ('%s') does not exist in the table schema.\",\n                eventTimeColumn));\n      }\n\n      Schema.Field eventTimeField = schema.getField(eventTimeColumn);\n      if (!Schema.TypeName.DATETIME.equals(eventTimeField.getType().getTypeName())) {\n        throw new IllegalArgumentException(\n            String.format(\n                \"The specified 'event-time.timestamp-column' ('%s') must be of type TIMESTAMP, but was '%s'.\",\n                eventTimeColumn, eventTimeField.getType()));","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datagen/DataGeneratorPTransform.java#L47-L83","documentation":"When a datagen table's TBLPROPERTIES set 'timestamp.behavior' to 'event-time', the transform needs a column to source event timestamps from. expand throws IllegalArgumentException when 'event-time.timestamp-column' is missing or null, because processing-time-based generation cannot be used in event-time mode.","triggerScenarios":"TBLPROPERTIES contains \"timestamp.behavior\": \"event-time\" but no 'event-time.timestamp-column' key, or its JSON value is null.","commonSituations":"Configuring event-time watermarking tests but forgetting the column property; nesting the property under the wrong JSON path; setting the behavior value in quotes incorrectly so only 'event-time' matches but the column key is absent.","solutions":["Add \"event-time.timestamp-column\": \"<column>\" to TBLPROPERTIES naming an existing TIMESTAMP field.","Ensure the JSON value is a non-null string column name.","Switch 'timestamp.behavior' to 'processing-time' if you do not actually need event-time semantics."],"exampleFix":"-- before\nTBLPROPERTIES '{\"rows-per-second\": 10, \"timestamp.behavior\": \"event-time\"}'\n\n-- after\nTBLPROPERTIES '{\"rows-per-second\": 10, \"timestamp.behavior\": \"event-time\", \"event-time.timestamp-column\": \"event_ts\"}'","handlingStrategy":"validation","validationCode":"if (\"event-time\".equalsIgnoreCase(properties.path(\"timestamp.behavior\").asText(\"processing-time\"))) {\n  JsonNode col = properties.path(\"event-time.timestamp-column\");\n  if (col.isMissingNode() || col.isNull()) {\n    throw new IllegalArgumentException(\"event-time behavior requires 'event-time.timestamp-column' in TBLPROPERTIES\");\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  PCollection<Row> rows = datagenTable.expand(input);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"'event-time.timestamp-column' must be specified\")) {\n    // add the column property or fall back to processing-time behavior\n  }\n}","preventionTips":["Whenever you set timestamp.behavior to event-time, add the timestamp-column property in the same edit.","Prefer processing-time behavior unless your test specifically needs event-time watermarks.","Keep behavior and its companion properties grouped in one TBLPROPERTIES constant."],"tags":["java","beam-sql","datagen","configuration"],"backgroundTag":"missing-required-config-field","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}