Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2401

Initializing decimal fields with fixed fields can cause padding issues in Java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • java
    • None

    Description

      I'm having a hard time figuring out if this a a bug or expected behavior.  If we initialize a decimal field with a fixed logical type that has fewer bytes then the fixed size has, then the bytes get padded on the right with 0s.  This changes their resulting decimal value.  I think they should be padded from the left.  The spec is vague here so I'm not sure if this is a bug or just unexpected outcome.

      I've attached my junit test.  The result of the test is:  AssertionError: expected:<660.51> but was:<169090.56>

      Attachments

        Issue Links

          Activity

            People

              zeshuai007 Zezeng Wang
              dig090 Gray
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: