[ 
https://issues.apache.org/jira/browse/HADOOP-1720?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12523880
 ] 

stack commented on HADOOP-1720:
-------------------------------

Here's some comments on the patch lads:

This is a large amount of new functionality but it is without unit tests.  
Regression in something as complicated as a shell is a real danger.  Do you 
have any objection to adding at least a basic test that does a setup of a 
minihbasecluster adding a table using your create command (with assertion that 
add was successful, and that all options specified were enabled, perhaps using 
your describe command), and then disable, enable, input, select, and drop 
asserting each of the steps has happened as you go?  (I can help out if you'd 
like).

The 'fs -ls' issue remains.  Do you want to fix that before committing or do 
you want to make a new issue to fix this?  (I tried setting the command back to 
'dfs' from 'fs' but it is still broken. Did I commit a broken feature?)

The describe command does not list out the properties that are advertised as 
settable in the create command.  Is this intentional? (this is a minor item I'd 
say)

I tried to create a table:

{code}
HBase > create testing ma_versions=3 compression=none in_memory 
bloomfilter=none;
Syntax error: Type 'help' for usage: Encountered "testing" at line 1, column 9.
HBase > create table testing ma_versions=3 compression=none in_memory 
bloomfilter=none;
Syntax error: Type 'help' for usage: Encountered "ma_versions" at line 1, 
column 23.
HBase > create table testing max_versions=3 compression=none in_memory 
bloomfilter=none;
Syntax error: Type 'help' for usage: Encountered "max_versions" at line 1, 
column 23.
HBase > create table testing family max_versions=3 compression=none in_memory 
bloomfilter=none;
Syntax error: Type 'help' for usage: Encountered "family" at line 1, column 23.
HBase > create table testing 'family' max_versions=3 compression=none in_memory 
bloomfilter=none;
Syntax error: Type 'help' for usage: Encountered "\'family\'" at line 1, column 
23.
HBase > create table testing 'family:' max_versions=3 compression=none 
in_memory bloomfilter=none;
Syntax error: Type 'help' for usage: Encountered "\'family:\'" at line 1, 
column 23.
HBase > create table testing family: max_versions=3 compression=none in_memory 
bloomfilter=none; 
Syntax error: Type 'help' for usage: Encountered "family:" at line 1, column 23.
HBase > create table 'testing' 'family:' max_versions=3 compression=none 
in_memory bloomfilter=none;
Syntax error: Type 'help' for usage: Encountered "\'testing\'" at line 1, 
column 15.
HBase > create table "testing" "family:" max_versions=3 compression=none 
in_memory bloomfilter=none;
Syntax error: Type 'help' for usage: Encountered "\"testing\"" at line 1, 
column 15.
HBase > create table testing family: max_versions=3 compression=none in_memory 
bloomfilter=none;   
Syntax error: Type 'help' for usage: Encountered "family:" at line 1, column 23.
HBase > create table testing test;
Syntax error: Type 'help' for usage: Encountered "test" at line 1, column 23.
{code}

I'm not sure what I'm doing wrong in the above.

It does not look as though I can put quotes around family names.  I would think 
I'd need to if a column qualifier had a space.  For example:

{code}
HBase > select repo:url;
Syntax error: Type 'help' for usage: Encountered ";" at line 1, column 17.
HBase > select 'repo:url' from hbaserepository;
Syntax error: Type 'help' for usage: Encountered "\'repo:url\'" at line 1, 
column 9.
HBase > select "repo:url" from hbaserepository;
Syntax error: Type 'help' for usage: Encountered "\"repo:url\"" at line 1, 
column 9.
HBase > select repo:url from hbaserepository;
{code}

(The last one above worked).

Trying to select a column from a specified row, the below happens:

{code}
HBase > select repo:url from hbaserepository where row=PPFW-00SOmohQD4kQcyk==;
Syntax error: Type 'help' for usage: Encountered "PPFW-00SOmohQD4kQcyk" at line 
1, column 49.
HBase > select repo:url from hbaserepository where row="PPFW-00SOmohQD4kQcyk==";
Exception in thread "main" java.lang.NullPointerException
        at org.apache.hadoop.io.Text.encode(Text.java:375)
        at org.apache.hadoop.io.Text.set(Text.java:165)
        at org.apache.hadoop.io.Text.<init>(Text.java:71)
        at 
org.apache.hadoop.hbase.shell.SelectCommand.setRowKey(SelectCommand.java:215)
        at 
org.apache.hadoop.hbase.shell.generated.Parser.selectCommand(Parser.java:593)
        at 
org.apache.hadoop.hbase.shell.generated.Parser.cmdStatement(Parser.java:137)
        at 
org.apache.hadoop.hbase.shell.generated.Parser.terminatedCommand(Parser.java:85)
        at org.apache.hadoop.hbase.Shell.main(Shell.java:60)
{code}

Digging further, it looks like I need to quote using single-quotes only -- is 
that right?  If so, we should put this fact into the help and perhaps into the 
shell preamble.

Regards the patch, it looks good.  I would suggest that error output be put on 
System.err rather than on System.out (In general you probably want to keep the 
errors and informational output on one stream and your generated output on the 
other).   You have an assert in DeleteCommand.  Why not make this throw an 
actual exception if passed value is null?

> [HbaseShell] Addition of HQL (Hbase Query Language) support in Hbase Shell
> --------------------------------------------------------------------------
>
>                 Key: HADOOP-1720
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1720
>             Project: Hadoop
>          Issue Type: Improvement
>          Components: contrib/hbase
>    Affects Versions: 0.15.0
>         Environment: all environments
>            Reporter: Inchul Song
>            Priority: Minor
>             Fix For: 0.15.0
>
>         Attachments: hql_v01.patch, hql_v02.patch, hql_v03.patch, 
> hql_v04.patch, hql_v05.patch, hql_v06.patch, hql_v07.patch, hql_v08.patch, 
> hql_v09.patch
>
>
> We have defined the HQL (Hbase Query Language), which is a "more" SQL-like 
> query language for Hbase, for use in Hbase Shell. HQL is not intended to 
> fully support the SQL syntax and semantics. HQL, instead, is developed to 
> make it easy to manipulate tables in Hbase through the Hbase Shell command 
> line, without using programming APIs.
> You can find more information about HQL in 
> http://wiki.apache.org/lucene-hadoop/Hbase/HbaseShell/HQL.

-- 
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