{"record":{"id":"b12c6854306bf5e4","repo":"apache/beam","slug":"error-decoding-single-byte-field","errorCode":null,"errorMessage":"error decoding single byte field","messagePattern":"error decoding single byte field","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/graph/coder/row_decoder.go","lineNumber":211,"sourceCode":"\t\t\t}\n\t\t}\n\t\treturn nil\n\t}, nil\n}\n\nfunc reflectDecodeBool(rv reflect.Value, r io.Reader) error {\n\tv, err := DecodeBool(r)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"error decoding bool field\")\n\t}\n\trv.SetBool(v)\n\treturn nil\n}\n\nfunc reflectDecodeByte(rv reflect.Value, r io.Reader) error {\n\tb, err := DecodeByte(r)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"error decoding single byte field\")\n\t}\n\trv.SetUint(uint64(b))\n\treturn nil\n}\n\nfunc reflectDecodeString(rv reflect.Value, r io.Reader) error {\n\tv, err := DecodeStringUTF8(r)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"error decoding string field\")\n\t}\n\trv.SetString(v)\n\treturn nil\n}\n\nfunc reflectDecodeInt(rv reflect.Value, r io.Reader) error {\n\tv, err := DecodeVarInt(r)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"error decoding varint field\")","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/graph/coder/row_decoder.go#L193-L229","documentation":"Wrap added by reflectDecodeByte in the reflective row decoder when DecodeByte fails reading a single-byte field from the element stream. The underlying cause is an I/O error or truncated/corruptly encoded row bytes; the wrap identifies that the failing field was a byte-sized unsigned field.","triggerScenarios":"reflectDecodeByte during row decoding when DecodeByte cannot read one byte: truncated stream, corrupt input, or misaligned decode of differently-coded data.","commonSituations":"Truncated Beam-encoded files, mixing data encoded with different field orders or coder versions.","solutions":["Confirm input data integrity and completeness.","Re-encode the data with the current coder.","Ensure writer and reader schemas match.","Inspect the stream position for mid-row truncation."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := decoderFn(rv, r); err != nil {\n    var wrapped error\n    if errors.As(err, &wrapped) && strings.Contains(err.Error(), \"single byte field\") {\n        return fmt.Errorf(\"truncated or corrupt byte field in row: %w\", err)\n    }\n    return err\n}","preventionTips":["Check file sizes/record counts before decoding batches.","Re-encode data after coder or schema changes.","Never decode bytes not produced by the matching Beam encoder.","Log read offsets for corruption triage."],"tags":["decode-error","byte-field","row-decoding","io"],"backgroundTag":"file-read-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"}