Skip to content

bug: DecimalLiteral.MarshalBinary produces incorrect results #731

@ella-chao

Description

@ella-chao

Apache Iceberg version

main (development)

Please describe the bug 🐞

There are two issues with this function:

  1. The carry from the increment here is lost, so given the input -256 for example [0xFE, 0x00] is returned instead of [0xFF, 00].
  2. The min bytes calculation here is wrong for -2^7, -2^15, etc. These fit in one fewer byte than what minBytes is reporting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions