{"record":{"id":"198dc8deeeb7cafa","repo":"apache/beam","slug":"column-headers-should-be-supplied-when-delimiter-is-present","errorCode":null,"errorMessage":"Column headers should be supplied when delimiter is present.","messagePattern":"Column headers should be supplied when delimiter is present\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/ml/src/main/java/org/apache/beam/sdk/extensions/ml/DLPDeidentifyText.java","lineNumber":179,"sourceCode":"      if (dlpDeidentifyText.getDeidentifyConfig() == null\n          && dlpDeidentifyText.getDeidentifyTemplateName() == null) {\n        throw new IllegalArgumentException(\n            \"Either deidentifyConfig or deidentifyTemplateName need to be set!\");\n      }\n      if (dlpDeidentifyText.getBatchSizeBytes() > DLP_PAYLOAD_LIMIT_BYTES) {\n        throw new IllegalArgumentException(\n            String.format(\n                \"Batch size is too large! It should be smaller or equal than %d.\",\n                DLP_PAYLOAD_LIMIT_BYTES));\n      }\n      if (dlpDeidentifyText.getColumnDelimiter() == null\n          && dlpDeidentifyText.getHeaderColumns() != null) {\n        throw new IllegalArgumentException(\n            \"Column delimiter should be set if headers are present.\");\n      }\n      if (dlpDeidentifyText.getHeaderColumns() == null\n          && dlpDeidentifyText.getColumnDelimiter() != null) {\n        throw new IllegalArgumentException(\n            \"Column headers should be supplied when delimiter is present.\");\n      }\n      return dlpDeidentifyText;\n    }\n  }\n\n  public static DLPDeidentifyText.Builder newBuilder() {\n    return new AutoValue_DLPDeidentifyText.Builder();\n  }\n\n  /**\n   * The transform converts the contents of input PCollection into {@link Table.Row}s and then calls\n   * Cloud DLP service to perform the deidentification according to provided settings.\n   *\n   * @param input input PCollection\n   * @return PCollection after transformations\n   */\n  @Override","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/ml/src/main/java/org/apache/beam/sdk/extensions/ml/DLPDeidentifyText.java#L161-L197","documentation":"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.","triggerScenarios":"Calling .setColumnDelimiter(...) without calling .setHeaderColumns(...) before build().","commonSituations":"Removing the header list during refactoring while keeping the delimiter; assuming headers are inferred from data.","solutions":["Add .setHeaderColumns(ImmutableList.of(...)) matching your data's columns.","Or remove setColumnDelimiter if headers are not used.","Supply both options together from validated pipeline options."],"exampleFix":"// before\n.setColumnDelimiter(\",\")\n.build();\n// after\n.setColumnDelimiter(\",\")\n.setHeaderColumns(ImmutableList.of(\"name\",\"ssn\"))\n.build();","handlingStrategy":"validation","validationCode":"if (columnDelimiter != null && headerColumns == null) throw new IllegalArgumentException(\"headerColumns required with columnDelimiter\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set headerColumns and columnDelimiter as a pair","Centralize DLP options building in one validated helper"],"tags":["java","dlp","builder-validation","config"],"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-20T03:17:13.778Z"}