You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "stack (JIRA)" <ji...@apache.org> on 2008/04/03 02:00:24 UTC
[jira] Updated: (HBASE-487) Replace hql w/ a hbase-friendly jirb or
jython shell
[ https://issues.apache.org/jira/browse/HBASE-487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
stack updated HBASE-487:
------------------------
Attachment: groovy.patch
Patch to get groovy into hbase. Currently type "./bin/hbase groovy" to make it work.
Jars to include are about 2.7M
Can use the groovy config. to preload the shell w/ hbase helper scripts and methods
Should do our own shell Main so we use later commons-cli, the one we include... that'd cut down on having to import one more jar and so we don't show 'inspect' in as a help option (I'm running groovy headless -- but maybe we want AWT and being able to inspect objects to see what their API, etc.)?
Here is sample:
{code}
durruti:~/Documents/checkouts/hbase/trunk stack$ ./bin/hbase groovy
Groovy Shell (1.5.4, JVM: 1.5.0_13-121)
Type 'help' or '\h' for help.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
groovy:000> help
For information about Groovy, visit:
http://groovy.codehaus.org
Available commands:
help (\h) Display this help message
? (\?) Alias to: help
exit (\x) Exit the shell
quit (\q) Alias to: exit
import (\i) Import a class into the namespace
display (\d) Display the current buffer
clear (\c) Clear the buffer
show (\S) Show variables, classes or imports
inspect (\n) Inspect a variable or the last result with the GUI object browser
purge (\p) Purge variables, classes, imports or preferences
edit (\e) Edit the current buffer
load (\l) Load a file or URL into the buffer
. (\.) Alias to: load
save (\s) Save the current buffer to a file
record (\r) Record the current session to a file
history (\H) Display, manage and recall edit-line history
alias (\a) Create an alias
set (\=) Set (or list) preferences
For help on a specific command type:
help command
groovy:000> import org.apache.hadoop.hbase.client.HTable
groovy:000> import org.apache.hadoop.hbase.HBaseConfiguration
groovy:000> c = new HBaseConfiguration()
...
{code}
> Replace hql w/ a hbase-friendly jirb or jython shell
> ----------------------------------------------------
>
> Key: HBASE-487
> URL: https://issues.apache.org/jira/browse/HBASE-487
> Project: Hadoop HBase
> Issue Type: Wish
> Reporter: stack
> Assignee: stack
> Priority: Minor
> Attachments: groovy.patch
>
>
> The hbase shell is a useful admin and debugging tool but it has a couple of downsides. To extend, a fragile parser definition needs tinkering-with and new java classes must be added. The current test suite for hql is lacking coverage and the current code could do with a rewrite having evolved piecemeal. Another downside is that the presence of an HQL interpreter gives the mis-impression that hbase is like a SQL database.
> This 'wish' issue suggests that we jettison HQL and instead offer users a jirb or jython command line. We'd ship with some scripts and jruby/jython classes that we'd source on startup to do things like import base client classes -- so folks wouldn't have to remember all the packages stuff sat in -- and added a pretty-print for scanners and getters outputting text, xhtml or binary. They would also make it easy to do HQL-things in jruby/python script.
> Advantages: Already-written parser with no need of extension probing deeper into hbase: i.e. better for debugging than HQL could ever be. Easy extension adding scripts/modules rather than java code. Less likely hbase could be confused for a SQL db.
> Downsides: Probably more verbose. Requires ruby or python knowledge ("Everyone knows some sql"). Big? (jruby lib is 24M).
> I was going to write security as downside but HQL suffers this at the moment too -- though it has been possible to sort the updates from the selects in the UI to prevent modification of the db from the UI, something that would be hard to do in a jruby/jython parser.
> What do others think?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.