Return-Path: X-Original-To: apmail-hive-user-archive@www.apache.org Delivered-To: apmail-hive-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 B1C8910223 for ; Wed, 12 Feb 2014 14:41:44 +0000 (UTC) Received: (qmail 5168 invoked by uid 500); 12 Feb 2014 14:41:41 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 4883 invoked by uid 500); 12 Feb 2014 14:41:40 -0000 Mailing-List: contact user-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hive.apache.org Delivered-To: mailing list user@hive.apache.org Received: (qmail 4868 invoked by uid 99); 12 Feb 2014 14:41:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Feb 2014 14:41:40 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of john.meagher@gmail.com designates 209.85.215.54 as permitted sender) Received: from [209.85.215.54] (HELO mail-la0-f54.google.com) (209.85.215.54) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Feb 2014 14:41:35 +0000 Received: by mail-la0-f54.google.com with SMTP id y1so7212545lam.13 for ; Wed, 12 Feb 2014 06:41:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=4Q2eRtLWGKukvppy02gfcSVvFzhuUJLp2HJfQ8GfNbI=; b=V6a7If11kiVfm0c+WFDlhhJRbF9EoDUKifvQXY1wfsdytcIVhi6if+n0gIAzUguaNW IBDI7UYGyaiRPqOh/5U53e+VIz5pM7Z4m29W/CfuJwl/IAmmSbQiA7fRi2XBFMrZFHn6 SER8insuy6O9111WkhsXzUxB3NF4kqjMsiZNxdaeBuihJ2Y5Lb1hgbeMGfihpO/BRxcZ 1MS3qSxZ6Dakf2lVB2uTNGqS4P9eqQrCRAAosoEJellbXFnX3bZoNlcWdb9/uI18SOnS XlJeLJF+fMvb2xU8t5CL3VOeKRc4GJ3cSMr0HPd31//ZyeYwPbEHUD8oU/j0abeL7+V3 65Eg== MIME-Version: 1.0 X-Received: by 10.152.2.169 with SMTP id 9mr2178059lav.48.1392216074386; Wed, 12 Feb 2014 06:41:14 -0800 (PST) Received: by 10.112.142.99 with HTTP; Wed, 12 Feb 2014 06:41:14 -0800 (PST) In-Reply-To: References: Date: Wed, 12 Feb 2014 09:41:14 -0500 Message-ID: Subject: Re: Can data be passed to the final mode init call in a UDAF? From: John Meagher To: user@hive.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org The code I'm having problems with is https://github.com/livingsocial/HiveSwarm/blob/WIP_scripting/src/main/java/com/livingsocial/hive/udf/ScriptedUDAF.java. There is a FIXME comment at the problem area where the return type for the init method can not be determined. On Mon, Feb 10, 2014 at 4:26 PM, John Meagher wrote: > I'm working on a UDAF that takes in a constant string that defines > what the final output of the UDAF will be. In the mode=PARTIAL1 call > to the init function all the parameters are available and the constant > can be read so the output ObjectInspector can be built. I haven't > found a way to pass this same constant data through so it is available > to the mode=FINAL call to init. > > Is there a way to pass constant parameters through the UDAF so it is > available in the mode=FINAL init call? > > I have tried having the PARTIAL1 init call return a > StructObjectInspector containing constant object inspectors with the > data, but when that is read during the FINAL call the incoming > ObjectInspectors are no longer constants. > > I've looked for ways to access the JobConf object for the job to try > to pass this parameter along, but I can't find a way to access that > from Hive. I can pass the data along with the data coming from > terminatePartial, but that data is not available until merge is called > and init in FINAL mode may be called without another invocation of > init. > > Note: this is with Hive 0.10. While I'd like to get this working > under 0.10 I'd like to know if this is a feature available in newer > releases. > > Thanks, > John