{"record":{"id":"1a57224d92c3ba9e","repo":"apache/beam","slug":"tablerows-are-not-deterministic","errorCode":null,"errorMessage":"TableRows are not deterministic.","messagePattern":"TableRows are not deterministic\\.","errorType":"exception","errorClass":"NonDeterministicException","httpStatus":null,"severity":"warning","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/TableRowInfoCoder.java","lineNumber":69,"sourceCode":"      throw new CoderException(\"cannot encode a null value\");\n    }\n    elementCoder.encode(value.tableRow, outStream);\n    idCoder.encode(value.uniqueId, outStream, context);\n  }\n\n  @Override\n  public TableRowInfo<ElementT> decode(InputStream inStream) throws IOException {\n    return decode(inStream, Context.NESTED);\n  }\n\n  @Override\n  public TableRowInfo<ElementT> decode(InputStream inStream, Context context) throws IOException {\n    return new TableRowInfo<>(elementCoder.decode(inStream), idCoder.decode(inStream, context));\n  }\n\n  @Override\n  public void verifyDeterministic() throws NonDeterministicException {\n    throw new NonDeterministicException(this, \"TableRows are not deterministic.\");\n  }\n\n  StringUtf8Coder idCoder = StringUtf8Coder.of();\n}\n","sourceCodeStart":51,"sourceCodeEnd":74,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/TableRowInfoCoder.java#L51-L74","documentation":"TableRowInfoCoder.verifyDeterministic always throws NonDeterministicException because TableRow JSON encodings are not byte-stable (field ordering / arbitrary object values). Beam requires deterministic coders for keyed state, grouping, and exact-dedup semantics, so this coder cannot be used where determinism is required.","triggerScenarios":"Using TableRowInfoCoder in an operation requiring deterministic encoding: GroupByKey on coders marked deterministic, stateful DoFns, or calls to verifyDeterministic() during pipeline construction/validation.","commonSituations":"Pipelines that group or deduplicate by a TableRow-containing key in BigQuery IO paths; users attempting to reuse the coder as a KV key coder.","solutions":["Do not use TableRowInfoCoder (or TableRow as a key) where determinism is required; key on a stable primitive like the table spec or unique id string instead.","Override the coder check with coder.verifyDeterministic() bypass only if you accept non-deterministic grouping semantics (risky, last resort).","Restructure the pipeline so TableRows are values, not keys."],"exampleFix":"// before\nKV<TableRow, Row> keyed = KV.of(tableRow, row); // nondeterministic key coder\n// after\nKV<String, Row> keyed = KV.of(tableRow.get(\"id\").toString(), row);","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Decide at graph construction time\ntry {\n  coder.verifyDeterministic();\n} catch (NonDeterministicException e) {\n  LOG.warn(\"Coder non-deterministic, use stable key: {}\", e.getMessage());\n}","preventionTips":["Never use TableRow/TableRowInfo as a grouping key; key on stable strings or ids.","Keep TableRows as values in GBK/stateful operations."],"tags":["java","beam","bigquery","determinism","coder"],"backgroundTag":"unsupported-operation","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"}