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

Allow interdependancies across IDL schema imports

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.3
    • Component/s: java
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      This currently doesn't work because Player depends on Position, but it should:

      $ cat position.avsc 
      {"type":"enum", "name": "Position", "namespace": "avro.examples.baseball",
          "symbols": ["P", "C", "B1", "B2", "B3", "SS", "LF", "CF", "RF", "DH"]
      }
      
      $ cat player.avsc 
      {"type":"record", "name":"Player", "namespace": "avro.examples.baseball",
        "fields": [
         {"name": "number", "type": "int"},
         {"name": "first_name", "type": "string"},
         {"name": "last_name", "type": "string"},
         {"name": "position", "type": {"type": "array", "items": "avro.examples.baseball.Position"} }
        ]
      }
      
      $ cat baseball.avdl 
      @namespace("avro.examples.baseball")
      protocol Baseball {
         import schema "position.avsc";
         import schema "player.avsc";
      }
      
      $ java -jar avro-tools-1.5.1.jar idl baseball.avdl baseball.avpr
      

        Attachments

        1. AVRO_872_commit.patch
          9 kB
          Bill Graham
        2. AVRO-872.patch
          9 kB
          Doug Cutting
        3. AVRO-872_4.patch
          8 kB
          Bill Graham
        4. AVRO-872.patch
          8 kB
          Doug Cutting
        5. AVRO-872.patch
          8 kB
          Doug Cutting
        6. AVRO-872.patch
          8 kB
          Doug Cutting

          Activity

            People

            • Assignee:
              cutting Doug Cutting
              Reporter:
              billgraham Bill Graham
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: