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

  1. Verify input completeness and encoder compatibility.
  2. Re-encode the source data with the current coder.
  3. Ensure schema evolution compatibility between writer and reader.
  4. 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

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


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)