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 8180099F8 for ; Wed, 25 Apr 2012 05:42:35 +0000 (UTC) Received: (qmail 31783 invoked by uid 500); 25 Apr 2012 05:42:34 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 31583 invoked by uid 500); 25 Apr 2012 05:42:34 -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 31561 invoked by uid 99); 25 Apr 2012 05:42:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Apr 2012 05:42:33 +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 dilip.antony.joseph@gmail.com designates 209.85.210.176 as permitted sender) Received: from [209.85.210.176] (HELO mail-iy0-f176.google.com) (209.85.210.176) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Apr 2012 05:42:28 +0000 Received: by iagw33 with SMTP id w33so2762308iag.35 for ; Tue, 24 Apr 2012 22:42:08 -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=tpYNoOBigELdCGBXzZEUBjtaw8A/k+HL7fqWRNw6EfI=; b=ZkD7QqAumrU7AWSszWxhjlIXmuu8SgLf8FHsNNRnP4TyjU1dhAmXZMu68mgiDBy+1y Bw8p5BZoxy1Nt2HcaoiTn5dMFSD8c9zuDo/AOnk+yhNqdnIxUzyBfunSemXcsBpC66SV Ni1GhTY5ZrUqEJwNJAaZLasqcsQMaMxRH895RjXUMAXMyNM9Icqn8wVCqSRvwBVubL/2 TvXTtElTpayeP5/GIgFjRdPWBjE906GSzm556igGK+98cSWVEtHkoKzfyd8jrCvaUXfD Bc5n6uLpNA5B6MxuhkZ2YctK7DMhg4UmCqzr/fi9ypCNFwkf6CqKFg3VIyNo8+226m/r p3Mw== MIME-Version: 1.0 Received: by 10.42.159.202 with SMTP id m10mr679984icx.50.1335332528226; Tue, 24 Apr 2012 22:42:08 -0700 (PDT) Received: by 10.42.241.9 with HTTP; Tue, 24 Apr 2012 22:42:08 -0700 (PDT) In-Reply-To: References: Date: Tue, 24 Apr 2012 22:42:08 -0700 Message-ID: Subject: Re: Embedding Hive From: Dilip Joseph To: user@hive.apache.org Content-Type: multipart/alternative; boundary=90e6ba6e8b3400820f04be7a5594 X-Virus-Checked: Checked by ClamAV on apache.org --90e6ba6e8b3400820f04be7a5594 Content-Type: text/plain; charset=ISO-8859-1 You can directly embed the hive client library in your java program, and use it without running a hive service. My blog post at http://csgrad.blogspot.com/2010/04/to-use-language-other-than-java-say.htmldescribes how to run hive queries from Jython. Something very similar should work for Java. Dilip On Tue, Apr 24, 2012 at 10:33 PM, Vinod Singh wrote: > Hello, > > I would like to embed Hive (client) in my application to execute a > sequence of queries. Right now I do it using CLI (hive -f myScript.sql). > Problem with this approach is that I do not get an return / error code to > know the status of query programmatically. > > So my question is what is the best way to embed Hive in a Java > application? I know JDBC is one approach but that will need Hive service > should be running somewhere and I want to avoid that. > > Thanks, > Vinod > -- _________________________________________ Dilip Antony Joseph http://csgrad.blogspot.com http://www.marydilip.info --90e6ba6e8b3400820f04be7a5594 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
You can directly embed the hive client library i= n your java program, and use it without running a hive service. =A0My blog = post at=A0http://csgrad.blogspot.com/2010/04/to-use-language-o= ther-than-java-say.html describes how to run hive queries from Jython. = =A0Something very similar should work for Java.

Dilip
On Tue, Apr 24, 2012 at 10:33 PM, Vinod Singh = <vinod@vinodsingh.com> wrote:
Hello,

I would like= to embed Hive (client) in my application to execute a sequence of queries.= Right now I do it using CLI (hive -f myScript.sql). Problem with this appr= oach is that I do not get an return / error code to know the status of quer= y=A0programmatically.

So my question is what is the best way to embed Hive in a Ja= va application? I know JDBC is one approach but that will need Hive service= should be running somewhere and I want to avoid that.

Thanks,
Vinod



--
____________= _____________________________
Dilip Antony Joseph
http://csgrad.blogspot.com
http://www.marydilip.info
--90e6ba6e8b3400820f04be7a5594--