Return-Path: X-Original-To: apmail-avro-user-archive@www.apache.org Delivered-To: apmail-avro-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B6FB01837F for ; Fri, 18 Dec 2015 14:26:06 +0000 (UTC) Received: (qmail 83682 invoked by uid 500); 18 Dec 2015 14:26:06 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 83608 invoked by uid 500); 18 Dec 2015 14:26:06 -0000 Mailing-List: contact user-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@avro.apache.org Delivered-To: mailing list user@avro.apache.org Received: (qmail 83596 invoked by uid 99); 18 Dec 2015 14:26:06 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Dec 2015 14:26:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id CEA081A1342 for ; Fri, 18 Dec 2015 14:26:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.02 X-Spam-Level: X-Spam-Status: No, score=-0.02 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=curoverse-com.20150623.gappssmtp.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 18UwtTc1L-x2 for ; Fri, 18 Dec 2015 14:26:00 +0000 (UTC) Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 389C92051D for ; Fri, 18 Dec 2015 14:26:00 +0000 (UTC) Received: by mail-wm0-f51.google.com with SMTP id p187so66762410wmp.0 for ; Fri, 18 Dec 2015 06:25:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=curoverse-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=U0mcc716tsSwvlORSvVJobafO68TJYzGNQm9/srZ+P8=; b=ooYny8Hp/R5eIGtN2ReNgqWjBUovMUxhLsgIFTS+21HGM2/ceQNYi8UTXOlUCjkqGf 6z4N3RXCpFAduhR8TcbzRMeyMKTT9Kur2VrhjHNVCpRbnrMdNGgDk8dFfqbuHMECaeO2 GNaxMUkJiDjmCjj5/Wk8py85LuikSWJBbq5fMMU2X3Lv/ZfAGosNbg70PSJn7tWCAMFK +QRJqMtv92L20hbBr5M4ru8MGrcvvlX2QUFbBg8O7IVoJIUnLDncqiNVaL+lQQp3U5E5 xq9cj9bhWfpo7OMsGDq++W4WOADubsAs40leX6EmcM3jPIIVHGLMF9k2mA8JRQy9N/an 1H4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=U0mcc716tsSwvlORSvVJobafO68TJYzGNQm9/srZ+P8=; b=f3wzXDFkxlT5+y2blljVAJAqPMX8eyeSIIM72KZN4fL+62lgWFMsghk1X+y5YHW8jy aK2k8VdtSx2hqenu9P8+KcPtwe8RIzF5B6i3G/+2jjcY4MYbcK8ZkJo8de7Njtx63dEi W44TaN7J7QanKbQMLkyTN1WhelfrKyCjRLknaFOmIznvuCWTXQcOM8oTGQv2kbRLq8Aq /hpW3XveB8va3Uz4xPAp4p2ZHujY0gOP11J+r2La4sIhbLgL07+2uMfOrR0siebV9jNz gv/Q7z30CxaIW/2VsLMVO5Hfl+IFMHKO2jQi3tS1zhPr8tYFqsKzdATXTxRDENs14uoc L4Wg== X-Gm-Message-State: ALoCoQldIWavJDVmB/szS5dD1NMoW+tH8EM+uaBuvtCrhr9c9/nmtcb7Tpeyvr/oZN7f2hgF55j3S7UzDQDRnp1UVudSx4vCkGV/bKDZ39hI350yJQjtJVU= MIME-Version: 1.0 X-Received: by 10.28.189.11 with SMTP id n11mr3717981wmf.27.1450448758609; Fri, 18 Dec 2015 06:25:58 -0800 (PST) Received: by 10.194.139.197 with HTTP; Fri, 18 Dec 2015 06:25:58 -0800 (PST) In-Reply-To: References: Date: Fri, 18 Dec 2015 09:25:58 -0500 Message-ID: Subject: Re: Avro Create Generic Type From: Peter Amstutz To: user@avro.apache.org Content-Type: text/plain; charset=UTF-8 Hi Rushi, Take a look at Schema Salad, it enables you to write a schema with inheritance and type templating and then run it through a processor to get a valid Avro schema, among other features: https://github.com/common-workflow-language/schema_salad (since it just converts to valid Avro, you won't get Java generics, though) On Thu, Dec 17, 2015 at 1:09 PM, Rushi wrote: > I am fairly certain that this is not possible currently, but thought I > should ask anyway. > > In Avro, is there a way to create generic types using schema files? As an > example, this is what I am looking to create: > > /** > * Autogenerated by Avro > * > * DO NOT EDIT DIRECTLY > */ > public class MyAvroType { > private Object value; // value will be of type T. > } > > Here, this parameterized java class would be generated by the > avro-maven-plugin or any other available plugin using the avsc files. > > What I am trying to solve is, to know the type of the value that will get > stored in the avro object so that I can find out any class compatibility > issues at compile time rather than at runtime. > > Thanks!