{"record":{"id":"e284f79f9a0bd81e","repo":"apache/beam","slug":"s-does-not-support-nested-fields-s","errorCode":null,"errorMessage":"'%s' does not support nested fields: %s","messagePattern":"'(.+?)' does not support nested fields: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/util/RowFilter.java","lineNumber":242,"sourceCode":"    return transformedSchema != null ? transformedSchema : rowSchema;\n  }\n\n  private void checkUnconfigured() {\n    Preconditions.checkState(\n        transformedSchema == null,\n        \"Invalid filter configuration: Please set only one of 'keep', 'drop', or 'only'.\");\n  }\n\n  /** Verifies that this selection contains no nested fields. */\n  private void verifyNoNestedFields(List<String> fields, String operation) {\n    List<String> nestedFields = new ArrayList<>();\n    for (String field : fields) {\n      if (field.contains(\".\")) {\n        nestedFields.add(field);\n      }\n    }\n    if (!nestedFields.isEmpty()) {\n      throw new IllegalArgumentException(\n          String.format(\"'%s' does not support nested fields: %s\", operation, nestedFields));\n    }\n  }\n\n  /**\n   * Checks whether a {@link Schema} contains a list of field names. Nested fields can be expressed\n   * with dot-notation. Throws a helpful error in the case where a field doesn't exist, or if a\n   * nested field could not be reached.\n   */\n  @VisibleForTesting\n  static void validateSchemaContainsFields(\n      Schema schema, List<String> specifiedFields, String operation) {\n    Set<String> notFound = new HashSet<>();\n    Set<String> notRowField = new HashSet<>();\n\n    for (String field : specifiedFields) {\n      List<String> levels = Splitter.on(\".\").splitToList(field);\n","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/util/RowFilter.java#L224-L260","documentation":"RowFilter.verifyNoNestedFields throws IllegalArgumentException when keep(), drop(), or only() is given field names containing dots (nested fields), because those operations only support top-level fields. The message names the operation and lists the offending nested field names. Nested field selection requires a different API; this guard prevents silently wrong filtering.","triggerScenarios":"rowFilter.keep(\"foo.bar\"), rowFilter.drop(\"a.b\"), or rowFilter.only(\"x.y\") with any dotted field name; verifyNoNestedFields is called by keep/drop/only.","commonSituations":"Users familiar with nested-field support in validateSchemaContainsFields/keep paths mistakenly pass dotted paths to drop() or only(); schema evolution introduces nested fields where flat ones were expected.","solutions":["Use only top-level field names with keep/drop/only.","Use RowFilter.keep()/drop() after flattening the schema, or operate on nested fields via the field-tree API (validateSchemaContainsFields supports nested paths).","Pre-flatten or explode nested rows before filtering."],"exampleFix":"// before\nrowFilter.only(\"user.name\", \"id\");\n// after\nrowFilter.only(\"user\", \"id\"); // top-level fields only","handlingStrategy":"validation","validationCode":"List<String> nested = fields.stream().filter(f -> f.contains(\".\")).collect(Collectors.toList());\nif (!nested.isEmpty()) {\n  throw new IllegalArgumentException(\"keep/drop/only do not support nested fields: \" + nested);\n}\nrowFilter.keep(fields.toArray(new String[0]));","typeGuard":null,"tryCatchPattern":"try {\n  PCollection<Row> out = rowFilter.only(fields);\n} catch (IllegalArgumentException e) {\n  throw new IllegalArgumentException(\"Use top-level field names with only(): \" + e.getMessage(), e);\n}","preventionTips":["Remember keep/drop/only operate on top-level fields only; dotted paths are rejected.","Flatten schemas or use the nested-field-capable validation path for deep selection.","Sanitize user-supplied field lists to reject dotted names up front."],"tags":["java","apache-beam","schema","nested-fields"],"backgroundTag":"invalid-argument-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}