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

The Avro ruby gem is unable to encode hashes with non-string keys

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.2
    • Fix Version/s: 1.10.0
    • Component/s: ruby
    • Labels:
      None

      Description

      When trying to encode a ruby hash which uses symbols, an error is raised because the key lookup is expecting a string only.

      { id: 4, name: "foo"} =>
      The datum nil is not an example of schema "long" (Avro::IO::AvroTypeError)

      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.

       

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jlambert121 Justin Lambert
                Reporter:
                jlambert121 Justin Lambert
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: