Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id ABC8A200C29 for ; Tue, 28 Feb 2017 13:57:44 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id AA484160B7C; Tue, 28 Feb 2017 12:57:44 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CCE0C160B6A for ; Tue, 28 Feb 2017 13:57:43 +0100 (CET) Received: (qmail 33293 invoked by uid 500); 28 Feb 2017 12:57:37 -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 33279 invoked by uid 99); 28 Feb 2017 12:57:37 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Feb 2017 12:57:37 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id CB642C094B for ; Tue, 28 Feb 2017 12:57:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.693 X-Spam-Level: *** X-Spam-Status: No, score=3.693 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id RRGAUTR4-Lmo for ; Tue, 28 Feb 2017 12:57:35 +0000 (UTC) Received: from mail-ua0-f170.google.com (mail-ua0-f170.google.com [209.85.217.170]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id EF3525F403 for ; Tue, 28 Feb 2017 12:57:34 +0000 (UTC) Received: by mail-ua0-f170.google.com with SMTP id f54so11981759uaa.1 for ; Tue, 28 Feb 2017 04:57:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=Uis99AJge0hjr68sK+mNH/+ORg5gmQyrcpweJVTVnoI=; b=HJvT1Uq0ORQEoV5D5PguKH8pPqglgIZQZUKcWWEq8D/VcskiyXIMfN6C8doosaVAvV sJRQkdyF9JwzH6sT4fS7D2kKqqCJx4HKP+MjhBxxQiO+/INozSpdfmCv+amIwXb9Cr9s VmXJhPl4+YppV0+Mj2iwpjc6XaPuSCfGDTqaM1cQxAzLPvGVvHKoQGu7CQfTFE8VvTUD lTXeFOZ2fxnvtq/Ujso4F7tj4aR7XGWRQvgPuYwWvJcGWxNPcmRVls7KkcdiUA7wszsu ot03a+v65Nkv1uYyQYWedUd/4RMsgsf/SCI/jRZhHYBjJudD9LJcW66ka88EKRD1wcVB krDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=Uis99AJge0hjr68sK+mNH/+ORg5gmQyrcpweJVTVnoI=; b=peAdFBmUzUCL1ZlQCR4A8dY1DPvgef3lKT1EPwTBqu2cVBB4daRjk5e2xxis71X9// LmWAmnjoCSgH6AaVh3tWPiCTKszlHpYiaPF1srr/lY4CL+Mz7wSBbNghy+k9lEThnSdw Rp5iOokzJGvl7KHKOs7xMq6b0LirrrOF92uaCeAFlJZILgnNr3C39JaQGgZwqcW40O6v XaFVMBfb5VjNj9kqGyd3F8bICaAmOKI5QRgAgRuE/fkXgBASvXqThWRPrUDmqxF6abHr n0BTJFCBZ7Wxx6rHT89T/pzicNWsuY2aIwNewxdR7GIDznlJWP4HMxNlpJLHYGLG8gJR G8pQ== X-Gm-Message-State: AMke39mShksCaD8oGKKtq/PjpQrHwaqFcUKReDK7Mo6q/1nddDoo3aiClM1Vs5Ruf6KwPEnp+p6Nb8a5uT9qLw== X-Received: by 10.31.213.7 with SMTP id m7mr743848vkg.48.1488286653270; Tue, 28 Feb 2017 04:57:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.44.138 with HTTP; Tue, 28 Feb 2017 04:57:32 -0800 (PST) In-Reply-To: <1488174530704-4036890.post@n3.nabble.com> References: <1487867813856-4036886.post@n3.nabble.com> <1488174530704-4036890.post@n3.nabble.com> From: Johannes Schulte Date: Tue, 28 Feb 2017 13:57:32 +0100 Message-ID: Subject: Re: Avro with MultipleInputs in the new API To: user@avro.apache.org Content-Type: multipart/alternative; boundary=94eb2c07aadc4ad88b054996bdac archived-at: Tue, 28 Feb 2017 12:57:44 -0000 --94eb2c07aadc4ad88b054996bdac Content-Type: text/plain; charset=UTF-8 I suggest you use Mapper,NullWritable> or even Mapper,NullWritable> You can than decide on sorting key by checking the datum() of the avro key with instanceof or with SpecificRecord#getSchema()#getName in the latter case. The schema for the map output (AvroJob#setMapOutputKeySchema()) will be the union again and the key depends on your use case. The sorting by default should use the provided key for sorting the (key,[values]) On Mon, Feb 27, 2017 at 6:48 AM, Zephod wrote: > Dear Johannes, > Thank you for your suggestion :) I know the types in advance (data model is > specific). Where could I read how the union type works? Are there any > examples e.g.: > -what kind of types should I use for type parameters of the mapper/reducer? > -how the values will be sorted in the shuffle phase? > -how do I check what type are the values I'm iterating over in the reducer? > > > > > > -- > View this message in context: http://apache-avro.679487.n3. > nabble.com/Avro-with-MultipleInputs-in-the-new-API-tp4036886p4036890.html > Sent from the Avro - Users mailing list archive at Nabble.com. > --94eb2c07aadc4ad88b054996bdac Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I suggest you use Mapper<AvroKey<Object>,NullWrit= able> or even Mapper<AvroKey<SpecificRecord>,NullWritable>
You can than decide on sorting key by checking the datum(= ) of the avro key with instanceof or with SpecificRecord#getSchema()#getNam= e in the latter case.=C2=A0
The schema for the map output (AvroJo= b#setMapOutputKeySchema()) will be the union again and the key depends on y= our use case. The sorting by default should use the provided key for sortin= g the (key,[values])



On Mon, Feb 27, 2017 at 6:48 A= M, Zephod <zephod@tlen.pl> wrote:
Dear Johannes,
Thank you for your suggestion :) I know the types in advance (data model is=
specific). Where could I read how the union type works? Are there any
examples e.g.:
-what kind of types should I use for type parameters of the mapper/reducer?=
-how the values will be sorted in the shuffle phase?
-how do I check what type are the values I'm iterating over in the redu= cer?





--
View this message in context: http://apache-avro.679487.n3.nabble.= com/Avro-with-MultipleInputs-in-the-new-API-tp4036886p4036890.htm= l
Sent from the Avro - Users mailing = list archive at Nabble.com.

--94eb2c07aadc4ad88b054996bdac--