You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Fokko Driesprong (Jira)" <ji...@apache.org> on 2020/04/11 06:51:00 UTC

[jira] [Resolved] (AVRO-2749) The Avro ruby gem is unable to encode hashes with non-string keys

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

Fokko Driesprong resolved AVRO-2749.
------------------------------------
    Fix Version/s: 1.10.0
       Resolution: Fixed

> The Avro ruby gem is unable to encode hashes with non-string keys
> -----------------------------------------------------------------
>
>                 Key: AVRO-2749
>                 URL: https://issues.apache.org/jira/browse/AVRO-2749
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: ruby
>    Affects Versions: 1.9.2
>            Reporter: Justin Lambert
>            Priority: Major
>             Fix For: 1.10.0
>
>
> When trying to encode a ruby hash which uses symbols, an error is raised because the key lookup is expecting a string only.
> {code:java}
> { id: 4, name: "foo"} =>
> The datum nil is not an example of schema "long" (Avro::IO::AvroTypeError){code}
> This error is a bit cryptic and since ruby supports all simple data types as hash keys, all keys should be converted to strings before encoding.
>  
>  



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