{"record":{"id":"fe0ace8c8beddfb7","repo":"apache/beam","slug":"the-specified-event-time-timestamp-column-s-must-be-of-type","errorCode":null,"errorMessage":"The specified 'event-time.timestamp-column' ('%s') must be of type TIMESTAMP, but was '%s'.","messagePattern":"The specified 'event-time\\.timestamp-column' \\('(.+?)'\\) must be of type TIMESTAMP, but was '(.+?)'\\.","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":80,"sourceCode":"      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()));\n      }\n\n      long maxOutOfOrdernessMs = properties.path(\"event_time.max-out-of-orderness\").asLong(0L);\n      generator = generator.withTimestampFn(new AdvancingTimestampFn(maxOutOfOrdernessMs));\n    }\n\n    return input\n        .getPipeline()\n        .apply(\"GenerateSequence\", generator)\n        .apply(\n            \"GenerateRows\", ParDo.of(new DataGeneratorRowFn(schema, properties, eventTimeColumn)))\n        .setRowSchema(schema);\n  }\n}\n","sourceCodeStart":62,"sourceCodeEnd":98,"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#L62-L98","documentation":"The datagen table provider validates that the column named in the 'event-time.timestamp-column' property has Beam type DATETIME (TIMESTAMP in SQL terms). This column is used to assign event-time watermarks for the generated rows, so a non-timestamp column cannot fulfill that role. The check runs during PTransform expansion, before the pipeline runs.","triggerScenarios":"Declaring a datagen table with 'event-time.timestamp-column' pointing at a schema field whose type is VARCHAR, INT, DATE, or any type other than TIMESTAMP/DATETIME; the IllegalArgumentException is thrown in DataGeneratorPTransform.expand.","commonSituations":"Copy-pasting table DDL where the timestamp column was changed to a string; pointing the column at a logical-type field that maps to something other than DATETIME; typos resolved to an existing but wrong-typed column.","solutions":["Change the referenced column's type in the table schema to TIMESTAMP (Schema.TypeName.DATETIME).","Point 'event-time.timestamp-column' at an existing TIMESTAMP-typed column in the schema.","Add a TIMESTAMP column to the schema if none exists and use it as the timestamp column."],"exampleFix":"// before\nCREATE EXTERNAL TABLE orders (id INT, event_time VARCHAR)\nTYPE 'datagen' TBLPROPERTIES '{\"event-time.timestamp-column\":\"event_time\"}'\n// after\nCREATE EXTERNAL TABLE orders (id INT, event_time TIMESTAMP)\nTYPE 'datagen' TBLPROPERTIES '{\"event-time.timestamp-column\":\"event_time\"}'","handlingStrategy":"validation","validationCode":"Schema schema = table.schema();\nString col = props.path(\"event-time.timestamp-column\").asText();\nSchema.Field f = schema.getField(col);\nif (f == null || !Schema.TypeName.DATETIME.equals(f.getType().getTypeName())) {\n  throw new IllegalArgumentException(col + \" must be a TIMESTAMP column\");\n}","typeGuard":"boolean isTimestampColumn(Schema schema, String name) {\n  Schema.Field f = schema.getField(name);\n  return f != null && Schema.TypeName.DATETIME.equals(f.getType().getTypeName());\n}","tryCatchPattern":"try { table.expand(...); } catch (IllegalArgumentException e) { /* fix schema/property, reconfigure DDL */ }","preventionTips":["Declare the event-time column as TIMESTAMP in the DDL.","Add a preflight schema check when generating table DDL programmatically."],"tags":["beam-sql","datagen","schema","config-validation"],"backgroundTag":"type-mismatch","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"}