apache/beam · error
error decoding double field
Error message
error decoding double field
What it means
Wrap added by reflectDecodeFloat when DecodeDouble fails reading an 8-byte double from the element stream. The cause is EOF/truncated row bytes or corrupt data for a float64 field — typically a producer/consumer coder mismatch or damaged intermediate data.
Solutions
- Verify input completeness and encoder compatibility.
- Re-encode the source data with the current coder.
- Ensure schema evolution compatibility between writer and reader.
- Inspect raw bytes at the failure point for corruption.
Defensive patterns
Strategy: try-catch
Try / catch
if err := decoderFn(rv, r); err != nil {
if strings.Contains(err.Error(), "error decoding double field") {
return fmt.Errorf("truncated float64 field in row: %w", err)
}
return err
} Prevention
- Verify each record has room for all 8-byte doubles before decoding.
- Keep float field types consistent between schema versions.
- Detect truncation (io.EOF) upstream and surface record offsets.
- Test decoding of persisted fixtures after any struct change.
When it happens
Trigger: reflectDecodeFloat during row decoding when DecodeDouble cannot read 8 bytes — truncated stream or misaligned field decode of incompatible data.
Common situations: Reading partially-written outputs, mixing pipeline versions with different row schemas, decoding foreign byte blobs.
Understand the failure class
Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.
Related errors
- error decoding bool field
- error decoding single byte field
- error decoding single-precision float field
- error decoding string field
- error decoding varint field
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/733bc0a9389d8b7e.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/go/pkg/beam/core/graph/coder/row_decoder.go:256
return errors.Wrap(err, "error decoding varint field")
}
rv.SetUint(v)
return nil
}
func reflectDecodeSinglePrecisionFloat(rv reflect.Value, r io.Reader) error {
v, err := DecodeSinglePrecisionFloat(r)
if err != nil {
return errors.Wrap(err, "error decoding single-precision float field")
}
rv.SetFloat(float64(v))
return nil
}
func reflectDecodeFloat(rv reflect.Value, r io.Reader) error {
v, err := DecodeDouble(r)
if err != nil {
return errors.Wrap(err, "error decoding double field")
}
rv.SetFloat(v)
return nil
}
func reflectDecodeByteSlice(rv reflect.Value, r io.Reader) error {
b, err := DecodeBytes(r)
if err != nil {
return errors.Wrap(err, "error decoding []byte field")
}
rv.SetBytes(b)
return nil
}
// customFunc returns nil if no custom func exists for this type.
// If an error is returned, coder construction should be aborted.
func (b *RowDecoderBuilder) customFunc(t reflect.Type) (func(io.Reader) (any, error), bool, error) {
if fact, ok := b.allFuncs[t]; ok {View on GitHub (pinned to 12126d8942)