Uploaded image for project: 'Parquet'
  1. Parquet
  2. PARQUET-1986

Request for Parquet Documentation for Fixed Decimal Type in JSON data representation

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 1.8.0
    • None
    • parquet-avro
    • Important

    Description

      We are trying to use a fixed type for logicalType Decimal. We create JSON and then convert it into Parquet. There, we are trying to call conversion.toFixed(), but it is returning in bytes (Array.toString(bytes)). We are using Avro 1.8 version.
       
      BigDecimal d1 = new BigDecimal("124.56")

      LogicalType decimal = LogicalTypes.decimal(9, 2);

      Schema fixedSchema = Schema.createFixed(Schema.Type.FIXED.name, null, null, 16);

      Conversion<BigDecimal> conversion = new Conversions.DecimalConversion();

      GenericFixed d1fixed = conversion.toFixed(d1, fixedSchema, decimal);
       
       
      Is there any method that we can use to convert it into 'Fixed text' that JSONDecoder is expecting? Any help will be appreciated.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              divyaSetia Divya
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: