{"record":{"id":"1019979f95d6bd49","repo":"apache/beam","slug":"either-startversion-or-starttimestamp-must-be-set","errorCode":null,"errorMessage":"Either startVersion or startTimestamp must be set.","messagePattern":"Either startVersion or startTimestamp must be set\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/delta/src/main/java/org/apache/beam/sdk/io/delta/DeltaIO.java","lineNumber":328,"sourceCode":"        }\n      }\n      return toBuilder().setMetadataColumns(Arrays.asList(metadataColumns)).build();\n    }\n\n    public ReadChanges withConfig(Map<String, String> config) {\n      return toBuilder().setHadoopConfig(config).build();\n    }\n\n    @Override\n    public PCollection<Row> expand(PBegin input) {\n      String path = getTablePath();\n      if (path == null) {\n        throw new IllegalArgumentException(\"Table path must be set.\");\n      }\n      if (getStartVersion() == null && getStartTimestamp() == null) {\n        // TODO: for unbounded reads, support using current HEAD or the latest snapshot\n        // as the default starting point.\n        throw new IllegalArgumentException(\"Either startVersion or startTimestamp must be set.\");\n      }\n      if (getStartVersion() != null && getStartTimestamp() != null) {\n        throw new IllegalArgumentException(\"Cannot set both startVersion and startTimestamp.\");\n      }\n      if (getEndVersion() != null && getEndTimestamp() != null) {\n        throw new IllegalArgumentException(\"Cannot set both endVersion and endTimestamp.\");\n      }\n\n      Configuration conf = new Configuration();\n      Map<String, String> hadoopConfig = getHadoopConfig();\n      if (hadoopConfig != null) {\n        for (Map.Entry<String, String> entry : hadoopConfig.entrySet()) {\n          conf.set(entry.getKey(), entry.getValue());\n        }\n      }\n      Engine engine = DefaultEngine.create(conf);\n      Table table = Table.forPath(engine, path);\n","sourceCodeStart":310,"sourceCodeEnd":346,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/delta/src/main/java/org/apache/beam/sdk/io/delta/DeltaIO.java#L310-L346","documentation":"expand() requires a starting point for the Delta read: either startVersion or startTimestamp must be provided. The connector does not yet default to the current/latest snapshot for unbounded reads (per the TODO), so a read with no start bound cannot be planned and throws IllegalArgumentException.","triggerScenarios":"Building DeltaIO.read() with a table path but never calling .withStartVersion() or .withStartTimestamp() before applying the transform.","commonSituations":"Copy-pasting example code that sets endVersion/endTimestamp but omits the start bound; migrating from a default-HEAD style API; assuming a streaming/unbounded read starts at latest snapshot automatically.","solutions":["Call .withStartVersion(long) with the desired snapshot version (e.g. 0 for full history)","Or call .withStartTimestamp(String/Instant) to start at a point in time","If you want 'latest', resolve the current version out-of-band and pass it explicitly as startVersion"],"exampleFix":"// before\nDeltaIO.read().withTable(path).withEndVersion(10L);\n// after\nDeltaIO.read().withTable(path).withStartVersion(0L).withEndVersion(10L);","handlingStrategy":"validation","validationCode":"if (startVersion == null && startTimestamp == null) {\n  throw new IllegalArgumentException(\"Set either .withStartVersion(...) or .withStartTimestamp(...)\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set a start bound (version 0 for a full read is a safe default)","Ensure option-parsing code never leaves both start fields null","Document in pipeline options that a start point is mandatory for Delta reads"],"tags":["java","apache-beam","delta-lake","configuration","validation"],"backgroundTag":"missing-required-argument","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"}