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

IDL compiler should use BigDecimal to represent decimal logical type.

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.0
    • Fix Version/s: 1.9.0, 1.8.2
    • Component/s: java
    • Labels:
      None
    • Release Note:
      Hide
      Users of the Java Specific API who have decimal logical types may now opt-in to having their generated classes use BigDecimal to represent values rather than the serialized ByteBuffer.

      To use this feature programmatically with the SpecificCompiler class, pass true to the setEnableDecimalLogicalType method.
       
      To use this feature with the specific compiler tool, pass the cli arg '-bigDecimal'.

      To use this feature with the avro maven plugin's code generation, set the configuration parameter enableDecimalLogicalType to true.
      Show
      Users of the Java Specific API who have decimal logical types may now opt-in to having their generated classes use BigDecimal to represent values rather than the serialized ByteBuffer. To use this feature programmatically with the SpecificCompiler class, pass true to the setEnableDecimalLogicalType method.   To use this feature with the specific compiler tool, pass the cli arg '-bigDecimal'. To use this feature with the avro maven plugin's code generation, set the configuration parameter enableDecimalLogicalType to true.

      Description

      Version 1.8.0 has added the support of logical types. A conversion class (Conversions.DecimalConversion) has also been added for decimal type. However, the IDL compiler still uses ByteBuffer for decimal types, which is not the same behaviour as data, time or timestamp type (added in AVRO-1684).

        Attachments

        1. AVRO-1847.1.patch
          2 kB
          Yibing Shi
        2. AVRO-1847.2.patch
          26 kB
          Yibing Shi
        3. AVRO-1847.3.patch
          38 kB
          Yibing Shi
        4. AVRO-1847.4.patch
          48 kB
          Yibing Shi
        5. AVRO-1847.5.patch
          51 kB
          Yibing Shi
        6. AVRO-1847.6.patch
          53 kB
          Yibing Shi
        7. AVRO-1847.7.patch
          55 kB
          Yibing Shi
        8. AVRO-1847.8.patch
          58 kB
          Yibing Shi

          Issue Links

            Activity

              People

              • Assignee:
                Yibing Yibing Shi
                Reporter:
                Yibing Yibing Shi
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: