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

Add Schema.createUnion(Schema... type)

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8.0
    • Component/s: java
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: