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 F0674DE5F for ; Thu, 9 Aug 2012 14:18:41 +0000 (UTC) Received: (qmail 99659 invoked by uid 500); 9 Aug 2012 14:18:40 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 99606 invoked by uid 500); 9 Aug 2012 14:18: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 99597 invoked by uid 99); 9 Aug 2012 14:18:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Aug 2012 14:18:40 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of prabhu.hive@gmail.com designates 209.85.161.176 as permitted sender) Received: from [209.85.161.176] (HELO mail-gg0-f176.google.com) (209.85.161.176) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Aug 2012 14:18:33 +0000 Received: by ggcs6 with SMTP id s6so527177ggc.35 for ; Thu, 09 Aug 2012 07:18:12 -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=uPH/S+2wkAzu7riulh0gI+1+gjhE3FgbErBJYHWmMEk=; b=e3jjS79lFLUHac0nunnj1TiUFI5JrXqoM6zAVruhMqETSREf15rI7UuQQx+bE3QUNV d2VPy+ZwgUy5Q02KFpYoccGlHPTMHH9+rRejOSjA5hVAK3+W0tSXG4lFn5YEfSGqcPUV N5XSz+8Tpk5BtHwyFIB1vRumiDpHJc6/Ji79BFB6mv/sdCSq+7ylb+qFGsG0Ud1E7S9V cLe4eXFGieXuXb1NMqRmOQA2DvmCd1mrcBUcqgWgxIDFfSFzr43u+5bOf5/lG8diXJtl lM1ipN0NA5Xv2aqg4eS3+FQgG1lFSl423JBzMGphu4wQrTvo7QFCX5kXP4+XfgWCf8Rk kUGA== MIME-Version: 1.0 Received: by 10.50.182.232 with SMTP id eh8mr1139938igc.48.1344521892159; Thu, 09 Aug 2012 07:18:12 -0700 (PDT) Received: by 10.64.135.7 with HTTP; Thu, 9 Aug 2012 07:18:12 -0700 (PDT) In-Reply-To: References: Date: Thu, 9 Aug 2012 19:48:12 +0530 Message-ID: Subject: Re: load data inot hive using shell script From: prabhu k To: user@hive.apache.org Content-Type: multipart/alternative; boundary=14dae9340e1bc6624504c6d5e59f --14dae9340e1bc6624504c6d5e59f Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks Jan, it's working fine. On Thu, Aug 9, 2012 at 7:32 PM, Jan Dolin=E1r wrote: > I'd suggest you to read a bit about shell scripts... To make this work yo= u > have to pass the queries to the hive via -e option. The way you wrote it, > interactive cli would be run and the queries would be attempted to be > executed by shell when cli ends. The correct skript in your case shouild > look like this: > > export HADOOP_HOME=3D/usr/local/hadoop > bin/hive -e "load data local inpath > '/usr/local/hadoop_dir/hadoop/input/sample.txt' overwrite into table > sample;" > > Note that 'exit' is not even necessary, hive will exit when it reaches en= d > of the last statement supplied. > > Best regards, > Jan > > > On Thu, Aug 9, 2012 at 3:57 PM, prabhu k wrote: > >> Hi Users, >> >> I m trying to load data into hive table using shell script. unable to >> load data into hive table. >> >> *sample.sh* >> export HADOOP_HOME=3D/usr/local/hadoop >> bin/hive >> load data local inpath '/usr/local/hadoop_dir/hadoop/input/sample.txt' >> overwrite into table sample; >> exit; >> >> Please suggest and help me. >> >> Thanks, >> Prabhu >> > > --14dae9340e1bc6624504c6d5e59f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks Jan, it's working fine.

On Thu, Aug 9, 2012 at 7:32 PM, Jan Dolin=E1r <dolik.rce@gmail.com> wrote:
I'd suggest you to read a bit abo= ut shell scripts... To make this work you have to pass the queries to the h= ive via -e option. The way you wrote it, interactive cli would be run and t= he queries would be attempted to be executed by shell when cli ends. The co= rrect skript in your case shouild look like this:=20

export HADOOP_HOME=3D/usr/local/hadoop
bin/hive -e "load data local inpath '/usr/local/hadoop_dir/ha= doop/input/sample.txt' overwrite into table sample;"

Note that 'exit' is not even necessary, hive will exit when it= reaches end of the last statement supplied.

Best regards,
Jan


On Thu, Aug 9, 2012 at 3:57 PM, prabhu k <p= rabhu.hive@gmail.com> wrote:
Hi Users,
=A0
I m trying to load data into hive table using shell script. unable to = load data into hive table.
=A0
sample.sh
export HADOOP_HOME=3D/usr/local/hadoop
bin/hive
load data local = inpath '/usr/local/hadoop_dir/hadoop/input/sample.txt' overwrite in= to table sample;
exit;
=A0
Please suggest and help me.
=A0
Thanks,
Prabhu


--14dae9340e1bc6624504c6d5e59f--