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

Allow for non-string keys

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.6, 1.7.7
    • 1.8.0
    • None
    • None

    Description

      Based on an email thread back in April, Doug Cutting proposed a possible solution for having non-string keys:

      Stu Hood wrote:
      > I can understand the reasoning behind AVRO-9, but now I need to look for an alternative to a 'map' that will allow me to store an association of bytes keys to values.

      A map of Foo has the same binary format as an array of records, each
      with a string field and a Foo field. So an application can use an array
      schema similar to this to represent map-like structures with, e.g.,
      non-string keys.

      Perhaps we could establish standard properties that indicate that a
      given array of records should be represented in a map-like way if
      possible? E.g.,:

      {"type": "array", "isMap": true, "items": {"type":"record", ...}}

      Doug

      Attachments

        1. AVRO-680.patch
          33 kB
          Sachin Goyal
        2. AVRO-680.patch
          32 kB
          Doug Cutting
        3. AVRO-680.patch
          24 kB
          Doug Cutting
        4. isMap_Call_Hierarchy.png
          192 kB
          Sachin Goyal
        5. non_string_map_keys.zip
          6 kB
          Sachin Goyal
        6. non_string_map_keys2.zip
          5 kB
          Sachin Goyal
        7. non_string_map_keys3.zip
          6 kB
          Sachin Goyal
        8. non_string_map_keys4.patch
          27 kB
          Sachin Goyal
        9. non_string_map_keys5.patch
          27 kB
          Sachin Goyal
        10. non_string_map_keys6.patch
          28 kB
          Sachin Goyal
        11. non_string_map_keys7.patch
          32 kB
          Sachin Goyal
        12. non_string_map_perf.txt
          10 kB
          Sachin Goyal
        13. non_string_map_perf2.txt
          9 kB
          Sachin Goyal
        14. original_perf.txt
          9 kB
          Sachin Goyal
        15. PERF_8000_cycles.zip
          6 kB
          Sachin Goyal

        Activity

          People

            sachingoyal Sachin Goyal
            jeromatron Jeremy Hanna
            Votes:
            5 Vote for this issue
            Watchers:
            12 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: