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 1865A11266 for ; Sun, 3 Aug 2014 10:21:09 +0000 (UTC) Received: (qmail 19196 invoked by uid 500); 3 Aug 2014 10:21:07 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 19120 invoked by uid 500); 3 Aug 2014 10:21:07 -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 19109 invoked by uid 99); 3 Aug 2014 10:21:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Aug 2014 10:21:07 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of malligarjunan@gmail.com designates 209.85.212.172 as permitted sender) Received: from [209.85.212.172] (HELO mail-wi0-f172.google.com) (209.85.212.172) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Aug 2014 10:21:03 +0000 Received: by mail-wi0-f172.google.com with SMTP id n3so3525700wiv.5 for ; Sun, 03 Aug 2014 03:20:42 -0700 (PDT) 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=p9XWQSwvYHD+Ks+ubL63R9Otbuu5aDregUlC7Tw3+r4=; b=z+xYJSqzxchckiBNBq4n5J9hklZARwD7vwEhKUMMbrXgxPTGhl/gAaSD636n3rhc6D ah+h4BXOMkAc9NP9xzmb8+TAMqHciqLg8WPGYqL+/V67+MaruvXiaucjXLJDSk+6wGZ4 MBdYMResYL4U4VEpE/5CTvLycovYuDE0yEqRL9BAWmwSg9NPGiayK7LTia3dxQyqt6MJ bFyJGQ885mO9oPfY0qOs2wXDaJCDK/+Yc6Pfcr5YHfbuZA6mEbYs54Kff9M2OtzJOD6/ KQ3Vc3BybJ06/UsLwt6Mnay3FKIQgnc7UpAFlU9NY16xqwRKQ9XE7Qgh3AnVJtFsnomp cDFw== MIME-Version: 1.0 X-Received: by 10.194.90.201 with SMTP id by9mr23427752wjb.94.1407061241977; Sun, 03 Aug 2014 03:20:41 -0700 (PDT) Received: by 10.217.40.199 with HTTP; Sun, 3 Aug 2014 03:20:41 -0700 (PDT) In-Reply-To: References: Date: Sun, 3 Aug 2014 15:50:41 +0530 Message-ID: Subject: Re: UDF with dependent JARs From: Malligarjunan S To: user@hive.apache.org Content-Type: multipart/alternative; boundary=047d7bd9148281655f04ffb6f955 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bd9148281655f04ffb6f955 Content-Type: text/plain; charset=UTF-8 Hello Tia, Try to use fat jar. If you are using maven, mvn assembly:single will generate the fat jar, which includes all necessary jars in a single jar file. Regards, Sankar S On Sat, Aug 2, 2014 at 5:17 PM, Brian Jeltema < brian.jeltema@digitalenvoy.net> wrote: > I've written a small UDF and placed it in a JAR (a.jar). > > The UDF has a dependency on a class in another JAR (b.jar). > > in Hive, I do: > > add jar a.jar; > add jar b.jar; > create temporary function .....; > > but when I execute the UDF, the dependency in b.jar is not found > (NoClassDefFoundError). > If I create a single JAR that contains the UDF and it's dependencies, the > function works. > Do all of the classes required for a UDF have to be supplied in a single > JAR file? > > TIA > Brian --047d7bd9148281655f04ffb6f955 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello Tia,

Try to use fat= jar.
If you are using maven, mvn assembly:single will generate th= e fat jar, which includes all necessary jars in a single jar file.

Regards,
Sankar S

On Sat, Aug 2, 2014 at 5:17 PM, Brian Jeltema = <brian.jeltema@digitalenvoy.net> wrote:
I've written a small UDF and placed it i= n a JAR (a.jar).

The UDF has a dependency on a class in another JAR (b.jar).

in Hive, I do:

=C2=A0 add jar a.jar;
=C2=A0 add jar b.jar;
=C2=A0 create temporary function .....;

but when I execute the UDF, the dependency in b.jar is not found (NoClassDe= fFoundError).
If I create a single JAR that contains the UDF and it's dependencies, t= he function works.
Do all of the classes required for a UDF have to be supplied in a single JA= R file?

TIA
Brian

--047d7bd9148281655f04ffb6f955--