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

Add support for forward declarations in avro IDL

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.8.0
    • 1.9.0
    • None
    • None
    • Hide
      With this patch recursive data structures will be supported in IDL:

      record SampleNode {
        int count = 0;
        array<SamplePair> samples = [];
      }
      record SamplePair {
       string name;
       SampleNode node;
      }

      Also the order of declaration of named types will not matter anymore. (similar with other languages like java)

      Compatibility:

      All schemas that are compilable with older versions of AVRO will continue working without issues.
      IDLs that will take advantage of the the features introduced with this patch, will not be compilable with older versions of AVRO
      please see the dependent JIRAs for more detail on related issues.
      Show
      With this patch recursive data structures will be supported in IDL: record SampleNode {   int count = 0;   array<SamplePair> samples = []; } record SamplePair {  string name;  SampleNode node; } Also the order of declaration of named types will not matter anymore. (similar with other languages like java) Compatibility: All schemas that are compilable with older versions of AVRO will continue working without issues. IDLs that will take advantage of the the features introduced with this patch, will not be compilable with older versions of AVRO please see the dependent JIRAs for more detail on related issues.
    • Patch

    Description

      Currently Recursive data structures like:

      record SampleNode {
      int count = 0;
      array<SamplePair> samples = [];
      }

      record SamplePair {
      string name;
      SampleNode node;
      }

      It is not possible to declare in IDL,
      however it is possible to declare in avsc (with fix from https://issues.apache.org/jira/browse/AVRO-1667 )

      It is actually not complicated to implement, here is some detail on a possible implementation:

      https://github.com/zolyfarkas/avro/commit/210c50105717149f3daa39b8d4160b8548b8e363

      This would close a capability gap with google protocol buffers...

      Attachments

        1. AVRO-1723.patch
          26 kB
          Zoltan Farkas

        Issue Links

          Activity

            People

              zolyfarkas Zoltan Farkas
              zolyfarkas Zoltan Farkas
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: