[ 
https://issues.apache.org/jira/browse/HBASE-487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12589687#action_12589687
 ] 

stack commented on HBASE-487:
-----------------------------

Having nice little classloader issues making groovy work.  Putting aside for 
the moment to play with rhino/js.

+ Need to figure out a readline for it.  It doesn't have it natively.
+ I like the way it reports syntax errors in-line rather than throwing pages of 
exceptions (groovy)
+ Does not autoimport java.lang because class name clashes got basic types.
+ Having trouble creating instances of hbase classes though I've done 
importPackage -- says 'TypeError: [JavaPackage 
org.apache.hadoop.hbase.HBaseConfiguration] is not a function, it is object.'  
Looks like I need to use full package names though the doc claims otherwise 
(Not friendly).  Its odd because I can do java classes fine but not hbase ones 
(must be doing something wrong):

{code}
js> var sb = new java.lang.StringBuffer();
js> var sb = new org.apache.hadoop.hbase.HBaseConfiguration();
js: "<stdin>", line 21: uncaught JavaScript runtime exception: TypeError: 
[JavaPackage org.apache.hadoop.hbase.HBaseConfiguration] is not a function, it 
is object.
        at <stdin>:21
{code}

+ Looks like I'd make an hbase object that subclassed the rhino 
ScriptableObject.  In here I could hide alot of the hbase'isms.

> 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-2.patch, 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.

Reply via email to