{"record":{"id":"8aabb541c63714ad","repo":"apache/beam","slug":"failed-to-parse-row-filter-text-proto","errorCode":null,"errorMessage":"Failed to parse row filter text proto","messagePattern":"Failed to parse row filter text proto","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java","lineNumber":1971,"sourceCode":"      return readOptions;\n    }\n\n    public List<ByteKeyRange> getRanges() {\n      return readOptions.getKeyRanges().get();\n    }\n\n    public @Nullable RowFilter getRowFilter() {\n      RowFilter.Chain.Builder chain = RowFilter.Chain.newBuilder();\n      ValueProvider<RowFilter> rowFilterValueProvider = readOptions.getRowFilter();\n      if (rowFilterValueProvider != null && rowFilterValueProvider.isAccessible()) {\n        chain.addFilters(rowFilterValueProvider.get());\n      }\n      ValueProvider<String> textFilterValueProvider = readOptions.getRowFilterTextProto();\n      if (textFilterValueProvider != null && textFilterValueProvider.isAccessible()) {\n        try {\n          chain.addFilters(TextFormat.parse(textFilterValueProvider.get(), RowFilter.class));\n        } catch (TextFormat.ParseException e) {\n          throw new RuntimeException(\"Failed to parse row filter text proto\", e);\n        }\n      }\n\n      switch (chain.getFiltersCount()) {\n        case 0:\n          return null;\n        case 1:\n          return chain.getFilters(0);\n        default:\n          return RowFilter.newBuilder().setChain(chain.build()).build();\n      }\n    }\n\n    public @Nullable Integer getMaxBufferElementCount() {\n      return readOptions.getMaxBufferElementCount();\n    }\n\n    public ValueProvider<String> getTableId() {","sourceCodeStart":1953,"sourceCodeEnd":1989,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java#L1953-L1989","documentation":"BigtableIO.Read allows a RowFilter to be supplied as a text-format protobuf string via BigtableReadOptions.getRowFilterTextProto(). When TextFormat.parse fails on that string, a RuntimeException('Failed to parse row filter text proto') is thrown with the ParseException as cause. The string must be a valid text-encoding of a google.bigtable.v2.RowFilter.","triggerScenarios":"Calling BigtableIO.read().withRowFilterTextProto(...) (or setting the pipeline option) with a string that is not valid text-proto: bad field names, missing escapes, invalid syntax, or wrong message nesting.","commonSituations":"Hand-written filter strings with typos, filters copied in wrong syntax (e.g. JSON instead of text proto), passing a regex with unescaped characters, forgetting to nest fields like chain { filters { ... } } correctly.","solutions":["Read the wrapped TextFormat.ParseException cause — it names the exact line/syntax problem","Validate the string by parsing locally: TextFormat.parse(text, RowFilter.class) in a unit test","Build the filter programmatically with RowFilter.newBuilder() and print with TextFormat.printer() to generate a known-valid string","Escape special characters in regex/bytes fields per text-proto rules (e.g. quoted strings)"],"exampleFix":"// before\n.withRowFilterTextProto(\"family_regex = 'stats.*'\")\n// after\n.withRowFilterTextProto(\"family_regex: 'stats.*'\")","handlingStrategy":"validation","validationCode":"String text = rowFilterTextProto.get();\ntry {\n  TextFormat.parse(text, com.google.bigtable.v2.RowFilter.class); // throws if invalid\n} catch (TextFormat.ParseException e) {\n  throw new IllegalArgumentException(\"Invalid RowFilter text proto: \" + e.getMessage(), e);\n}","typeGuard":null,"tryCatchPattern":"try {\n  BigtableIO.read().withBigtableOptions(opts).withRowFilterTextProto(text).expand(...);\n} catch (RuntimeException e) {\n  if (e.getCause() instanceof TextFormat.ParseException) {\n    // fix the text proto syntax named in the cause\n  }\n  throw e;\n}","preventionTips":["Generate filter strings with RowFilter.newBuilder() + TextFormat.print() instead of hand-writing them","Unit-test the filter string by parsing it before deploying","Remember text-proto field syntax uses colons and quoted strings"],"tags":["java","bigtable","protobuf","parsing"],"backgroundTag":"protobuf-unmarshal-failed","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"}