You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Sergey Toy (Jira)" <ji...@apache.org> on 2020/01/08 07:19:00 UTC

[jira] [Updated] (AVRO-2677) Decimal logical type don't serialize precision and scale in Ruby

     [ https://issues.apache.org/jira/browse/AVRO-2677?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Toy updated AVRO-2677:
-----------------------------
    Description: 
 
{code:java}
payload = '{ "type": "bytes", "logicalType": "decimal", "precision": 9, "scale": 2 }'
result = Avro::Schema.real_parse(JSON.parse(payload))
result.to_avro # => {"type"=>"bytes", "logicalType"=>"decimal"}{code}
 

Should be
{code:java}
{"type"=>"bytes", "logicalType"=>"decimal", "precision"=>9, "scale"=>2}{code}

  was:
```ruby

payload = '\{ "type": "bytes", "logicalType": "decimal", "precision": 9, "scale": 2 }'
result = Avro::Schema.real_parse(JSON.parse(payload))
result.to_avro # => \{"type"=>"bytes", "logicalType"=>"decimal"}

```

Should be

```ruby

{"type"=>"bytes", "logicalType"=>"decimal", "precision"=>9, "scale"=>2}

```


> Decimal logical type don't serialize precision and scale in Ruby
> ----------------------------------------------------------------
>
>                 Key: AVRO-2677
>                 URL: https://issues.apache.org/jira/browse/AVRO-2677
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: ruby
>            Reporter: Sergey Toy
>            Priority: Major
>
>  
> {code:java}
> payload = '{ "type": "bytes", "logicalType": "decimal", "precision": 9, "scale": 2 }'
> result = Avro::Schema.real_parse(JSON.parse(payload))
> result.to_avro # => {"type"=>"bytes", "logicalType"=>"decimal"}{code}
>  
> Should be
> {code:java}
> {"type"=>"bytes", "logicalType"=>"decimal", "precision"=>9, "scale"=>2}{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)