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

Add feature to know if schema is imported in avdl

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.11.2, 1.11.3
    • None
    • java
    • None

    Description

      consider the this invoice.avdl:

      @namespace("purchase")
      protocol InvoiceProtocol{
         import idl "../customer/data.avdl";  
         import idl "../product/data.avdl";    
         record Invoice{
            timestamp_ms purchaseTime;
            customer.Customer customer;
            array<product.Item> items = [];
         }
      }

      now, if I do this:

      for(Schema s : protocol.getTypes()){
         System.out.println(s.getName() + " " + s.isImported());
      }

      this should produce

      Customer true
      Item true
      Invoice false

      I have some use case where we want to perform operations only to the "main" schema and leave all imported schema alone.

      This feature (s.isImported()) would be really nice to have (if it's not available already).

      Thanks

      Attachments

        Activity

          People

            Unassigned Unassigned
            architucas Thun Hak
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: