{"record":{"id":"2e843b6282e409cc","repo":"apache/beam","slug":"error-decoding-single-precision-float-field","errorCode":null,"errorMessage":"error decoding single-precision float field","messagePattern":"error decoding single-precision float field","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/graph/coder/row_decoder.go","lineNumber":247,"sourceCode":"\t\treturn errors.Wrap(err, \"error decoding varint field\")\n\t}\n\trv.SetInt(v)\n\treturn nil\n}\n\nfunc reflectDecodeUint(rv reflect.Value, r io.Reader) error {\n\tv, err := DecodeVarUint64(r)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"error decoding varint field\")\n\t}\n\trv.SetUint(v)\n\treturn nil\n}\n\nfunc reflectDecodeSinglePrecisionFloat(rv reflect.Value, r io.Reader) error {\n\tv, err := DecodeSinglePrecisionFloat(r)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"error decoding single-precision float field\")\n\t}\n\trv.SetFloat(float64(v))\n\treturn nil\n}\n\nfunc reflectDecodeFloat(rv reflect.Value, r io.Reader) error {\n\tv, err := DecodeDouble(r)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"error decoding double field\")\n\t}\n\trv.SetFloat(v)\n\treturn nil\n}\n\nfunc reflectDecodeByteSlice(rv reflect.Value, r io.Reader) error {\n\tb, err := DecodeBytes(r)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"error decoding []byte field\")","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/graph/coder/row_decoder.go#L229-L265","documentation":"Wrap added by reflectDecodeSinglePrecisionFloat when DecodeSinglePrecisionFloat fails pulling a 4-byte float from the row byte stream. It signals truncated or corrupt element data for a float32-typed field, or a coder mismatch between producer and consumer.","triggerScenarios":"reflectDecodeSinglePrecisionFloat during row decoding when DecodeSinglePrecisionFloat cannot read 4 bytes — truncated input or misaligned decoding.","commonSituations":"Truncated output files, schema drift changing field layout, decoding data with mismatched coder versions.","solutions":["Confirm the data source is intact and produced by a compatible encoder.","Re-encode the data.","Verify reader/writer schemas match field-for-field.","Check truncation at the failing offset."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := decoderFn(rv, r); err != nil {\n    if strings.Contains(err.Error(), \"single-precision float\") {\n        return fmt.Errorf(\"truncated float32 field in row: %w\", err)\n    }\n    return err\n}","preventionTips":["Ensure float32 fields are not altered to float64 (or vice versa) without schema migration.","Verify encoded blob lengths match expected field sizes.","Use checksums on stored outputs.","Keep writer/reader Beam SDK versions compatible."],"tags":["decode-error","float32-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"}