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

Add Schema.createUnion(Schema... type)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 1.8.0
    • java
    • None

    Description

      Quite often, when I declare mapreduce jobs I have to create the union of two or three schemas. For example:

      AvroJob.setMapOutputKeySchema(job, Schema.createUnion(Arrays.asList(Foo.SCHEMA$, Bar.SCHEMA$))
      

      Having Schema.createUnion only accept a List hurts readability and force users to write boilerplate code for such trivial, but I believe common, use cases. It would be create to add Schema.createUnion(Schema... type)

      Attachments

        1. AVRO-1628.patch
          2 kB
          Clément MATHIEU
        2. AVRO-1628.patch
          2 kB
          Clément MATHIEU

        Activity

          People

            clement@unportant.info Clément MATHIEU
            clement@unportant.info Clément MATHIEU
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: