You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by di...@gmail.com on 2015/08/21 14:10:30 UTC

Execute script file from with in HBase shell

Hi,


I am able to execute HBase commands present in a file like below,


$ ./hbase shell ./sample_commands.txt
0 row(s) in 3.4170 seconds

But I would like to know how to execute commands file from with in HBase shell; Because while executing multiple command files, shell opens/close each time; Rather Hive / Pig have a good feature “source FILE <filepath>”. This allows more than 1 files to get executed in single Hive prompt



Hive reference: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Cli#LanguageManualCli-HiveInteractiveShellCommands


I am using Windows Operating system




Thanks,

Dinesh



Sent from Windows Mail

Re: Execute script file from with in HBase shell

Posted by Elliott Clark <ec...@apache.org>.
Additionally the shell takes in input on what to run from stdin. So you can
cat 'somefile' | hbase shell > output

On Fri, Aug 21, 2015 at 9:05 AM, Sean Busbey <bu...@cloudera.com> wrote:

> The HBase shell is currently just an IRB[1] session in JRuby[2]. By default
> it runs in Ruby 1.8 mode, and you can use the 'load' command to bring in
> additional ruby scripts[3].
>
>
>
> [1]: http://ruby-doc.com/docs/ProgrammingRuby/html/irb.html
> [2]: http://jruby.org/
> [3]: http://ruby-doc.org/core-1.8.7/Kernel.html#method-i-load
>
> On Fri, Aug 21, 2015 at 10:41 AM, <di...@gmail.com> wrote:
>
> > Any plan to implement in future?
> >
> >
> > Best,
> >
> > Dinesh
> >
> >
> >
> >
> >
> >
> > Sent from Windows Mail
> >
> >
> >
> >
> >
> > From: Ted Yu
> > Sent: ‎Friday‎, ‎21‎ ‎August‎ ‎2015 ‎06‎:‎01‎ ‎PM
> > To: dev@hbase.apache.org
> >
> >
> >
> >
> >
> > To my knowledge, there is no such command in HBase shell.
> >
> > Cheers
> >
> >
> >
> > > On Aug 21, 2015, at 5:10 AM, <di...@gmail.com> <
> dinuswt22@gmail.com>
> > wrote:
> > >
> > > Hi,
> > >
> > >
> > > I am able to execute HBase commands present in a file like below,
> > >
> > >
> > > $ ./hbase shell ./sample_commands.txt
> > > 0 row(s) in 3.4170 seconds
> > >
> > > But I would like to know how to execute commands file from with in
> HBase
> > shell; Because while executing multiple command files, shell opens/close
> > each time; Rather Hive / Pig have a good feature “source FILE
> <filepath>”.
> > This allows more than 1 files to get executed in single Hive prompt
> > >
> > >
> > >
> > > Hive reference:
> >
> https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Cli#LanguageManualCli-HiveInteractiveShellCommands
> > >
> > >
> > > I am using Windows Operating system
> > >
> > >
> > >
> > >
> > > Thanks,
> > >
> > > Dinesh
> > >
> > >
> > >
> > > Sent from Windows Mail
> >
>
>
>
> --
> Sean
>

Re: Execute script file from with in HBase shell

Posted by Sean Busbey <bu...@cloudera.com>.
The HBase shell is currently just an IRB[1] session in JRuby[2]. By default
it runs in Ruby 1.8 mode, and you can use the 'load' command to bring in
additional ruby scripts[3].



[1]: http://ruby-doc.com/docs/ProgrammingRuby/html/irb.html
[2]: http://jruby.org/
[3]: http://ruby-doc.org/core-1.8.7/Kernel.html#method-i-load

On Fri, Aug 21, 2015 at 10:41 AM, <di...@gmail.com> wrote:

> Any plan to implement in future?
>
>
> Best,
>
> Dinesh
>
>
>
>
>
>
> Sent from Windows Mail
>
>
>
>
>
> From: Ted Yu
> Sent: ‎Friday‎, ‎21‎ ‎August‎ ‎2015 ‎06‎:‎01‎ ‎PM
> To: dev@hbase.apache.org
>
>
>
>
>
> To my knowledge, there is no such command in HBase shell.
>
> Cheers
>
>
>
> > On Aug 21, 2015, at 5:10 AM, <di...@gmail.com> <di...@gmail.com>
> wrote:
> >
> > Hi,
> >
> >
> > I am able to execute HBase commands present in a file like below,
> >
> >
> > $ ./hbase shell ./sample_commands.txt
> > 0 row(s) in 3.4170 seconds
> >
> > But I would like to know how to execute commands file from with in HBase
> shell; Because while executing multiple command files, shell opens/close
> each time; Rather Hive / Pig have a good feature “source FILE <filepath>”.
> This allows more than 1 files to get executed in single Hive prompt
> >
> >
> >
> > Hive reference:
> https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Cli#LanguageManualCli-HiveInteractiveShellCommands
> >
> >
> > I am using Windows Operating system
> >
> >
> >
> >
> > Thanks,
> >
> > Dinesh
> >
> >
> >
> > Sent from Windows Mail
>



-- 
Sean

Re: Execute script file from with in HBase shell

Posted by di...@gmail.com.
Any plan to implement in future?


Best,

Dinesh






Sent from Windows Mail





From: Ted Yu
Sent: ‎Friday‎, ‎21‎ ‎August‎ ‎2015 ‎06‎:‎01‎ ‎PM
To: dev@hbase.apache.org





To my knowledge, there is no such command in HBase shell. 

Cheers



> On Aug 21, 2015, at 5:10 AM, <di...@gmail.com> <di...@gmail.com> wrote:
> 
> Hi,
> 
> 
> I am able to execute HBase commands present in a file like below,
> 
> 
> $ ./hbase shell ./sample_commands.txt
> 0 row(s) in 3.4170 seconds
> 
> But I would like to know how to execute commands file from with in HBase shell; Because while executing multiple command files, shell opens/close each time; Rather Hive / Pig have a good feature “source FILE <filepath>”. This allows more than 1 files to get executed in single Hive prompt
> 
> 
> 
> Hive reference: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Cli#LanguageManualCli-HiveInteractiveShellCommands
> 
> 
> I am using Windows Operating system
> 
> 
> 
> 
> Thanks,
> 
> Dinesh
> 
> 
> 
> Sent from Windows Mail

Re: Execute script file from with in HBase shell

Posted by Ted Yu <yu...@gmail.com>.
To my knowledge, there is no such command in HBase shell. 

Cheers



> On Aug 21, 2015, at 5:10 AM, <di...@gmail.com> <di...@gmail.com> wrote:
> 
> Hi,
> 
> 
> I am able to execute HBase commands present in a file like below,
> 
> 
> $ ./hbase shell ./sample_commands.txt
> 0 row(s) in 3.4170 seconds
> 
> But I would like to know how to execute commands file from with in HBase shell; Because while executing multiple command files, shell opens/close each time; Rather Hive / Pig have a good feature “source FILE <filepath>”. This allows more than 1 files to get executed in single Hive prompt
> 
> 
> 
> Hive reference: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Cli#LanguageManualCli-HiveInteractiveShellCommands
> 
> 
> I am using Windows Operating system
> 
> 
> 
> 
> Thanks,
> 
> Dinesh
> 
> 
> 
> Sent from Windows Mail