apache/beam · error · IllegalArgumentException

Column headers should be supplied when delimiter is present.

Error message

Column headers should be supplied when delimiter is present.

What it means

The mirror validation of [1108]: if a columnDelimiter is set but headerColumns are not, the builder throws IllegalArgumentException because a delimiter without headers is meaningless/ambiguous for the table inspection configuration.

Solutions

  1. Add .setHeaderColumns(ImmutableList.of(...)) matching your data's columns.
  2. Or remove setColumnDelimiter if headers are not used.
  3. Supply both options together from validated pipeline options.

Example fix

// before
.setColumnDelimiter(",")
.build();
// after
.setColumnDelimiter(",")
.setHeaderColumns(ImmutableList.of("name","ssn"))
.build();
Defensive patterns

Strategy: validation

Validate before calling

if (columnDelimiter != null && headerColumns == null) throw new IllegalArgumentException("headerColumns required with columnDelimiter");

Prevention

When it happens

Trigger: Calling .setColumnDelimiter(...) without calling .setHeaderColumns(...) before build().

Common situations: Removing the header list during refactoring while keeping the delimiter; assuming headers are inferred from data.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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

Appendix: source

Thrown at sdks/java/extensions/ml/src/main/java/org/apache/beam/sdk/extensions/ml/DLPDeidentifyText.java:179

      if (dlpDeidentifyText.getDeidentifyConfig() == null
          && dlpDeidentifyText.getDeidentifyTemplateName() == null) {
        throw new IllegalArgumentException(
            "Either deidentifyConfig or deidentifyTemplateName need to be set!");
      }
      if (dlpDeidentifyText.getBatchSizeBytes() > DLP_PAYLOAD_LIMIT_BYTES) {
        throw new IllegalArgumentException(
            String.format(
                "Batch size is too large! It should be smaller or equal than %d.",
                DLP_PAYLOAD_LIMIT_BYTES));
      }
      if (dlpDeidentifyText.getColumnDelimiter() == null
          && dlpDeidentifyText.getHeaderColumns() != null) {
        throw new IllegalArgumentException(
            "Column delimiter should be set if headers are present.");
      }
      if (dlpDeidentifyText.getHeaderColumns() == null
          && dlpDeidentifyText.getColumnDelimiter() != null) {
        throw new IllegalArgumentException(
            "Column headers should be supplied when delimiter is present.");
      }
      return dlpDeidentifyText;
    }
  }

  public static DLPDeidentifyText.Builder newBuilder() {
    return new AutoValue_DLPDeidentifyText.Builder();
  }

  /**
   * The transform converts the contents of input PCollection into {@link Table.Row}s and then calls
   * Cloud DLP service to perform the deidentification according to provided settings.
   *
   * @param input input PCollection
   * @return PCollection after transformations
   */
  @Override

View on GitHub (pinned to 12126d8942)