Thanks Jan, it's working fine. On Thu, Aug 9, 2012 at 7:32 PM, Jan DolinĂ¡r <[email protected]> wrote:
> I'd suggest you to read a bit about shell scripts... To make this work you > 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=/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 end > of the last statement supplied. > > Best regards, > Jan > > > On Thu, Aug 9, 2012 at 3:57 PM, prabhu k <[email protected]> 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=/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 >> > >
