apache/beam · error · IllegalArgumentException

Table path must be set.

Error message

Table path must be set.

What it means

DeltaIO.Read's expand() validates that a table path was configured via .from(path). Reading requires a Delta table location; with a null path the connector cannot build the table and throws IllegalArgumentException during pipeline expansion (at graph construction, before any data flows).

Solutions

  1. Call .from("<delta table path>") on the read transform before applying it to the pipeline.
  2. If the path comes from options, fail fast with a clear message when the option is absent (validate in your main before Pipeline.run).
  3. Check builder chaining so later toBuilder()/build() calls don't reset tablePath to null.

Example fix

// before
DeltaIO.read().withVersion(5L).apply(...); // no .from()
// after
DeltaIO.read().from("s3://bucket/delta/table").withVersion(5L).apply(...);
Defensive patterns

Strategy: validation

Validate before calling

if (options.getDeltaTablePath() == null || options.getDeltaTablePath().isEmpty()) { throw new IllegalArgumentException("--deltaTablePath is required"); }
DeltaIO.read().from(options.getDeltaTablePath()).apply(...);

Type guard

static boolean hasPath(DeltaIO.Read read) { return read.getTablePath() != null; }

Try / catch

try { pipeline.run(); } catch (IllegalArgumentException e) { if (e.getMessage().equals("Table path must be set.")) { printUsageAndExit(); } else { throw e; } }

Prevention

When it happens

Trigger: Building a DeltaIO.read() transform and forgetting .from("/path/to/table"), or calling toBuilder-style builders that cleared tablePath.

Common situations: Path supplied from a nullable config/option (e.g. an unset PipelineOption) that was never validated before expansion; copy-pasted builder where .from() was dropped.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/50320011de93cdd4. Report an issue: GitHub.

Appendix: source

Thrown at sdks/java/io/delta/src/main/java/org/apache/beam/sdk/io/delta/DeltaIO.java:136

    }

    public ReadRows withVersion(@Nullable Long version) {
      return toBuilder().setVersion(version).build();
    }

    public ReadRows withTimestamp(@Nullable String timestamp) {
      return toBuilder().setTimestamp(timestamp).build();
    }

    public ReadRows withConfig(Map<String, String> config) {
      return toBuilder().setHadoopConfig(config).build();
    }

    @Override
    public PCollection<Row> expand(PBegin input) {
      String path = getTablePath();
      if (path == null) {
        throw new IllegalArgumentException("Table path must be set.");
      }
      if (getVersion() != null && getTimestamp() != null) {
        throw new IllegalArgumentException("Cannot set both version and timestamp.");
      }

      Configuration conf = new Configuration();
      Map<String, String> hadoopConfig = getHadoopConfig();
      if (hadoopConfig != null) {
        for (Map.Entry<String, String> entry : hadoopConfig.entrySet()) {
          conf.set(entry.getKey(), entry.getValue());
        }
      }
      Engine engine = DefaultEngine.create(conf);
      Table table = Table.forPath(engine, path);
      Snapshot snapshot;
      Long versionVal = getVersion();
      String timestampVal = getTimestamp();
      if (versionVal != null) {

View on GitHub (pinned to 12126d8942)