hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "stack (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-1375) a simple parser for hbase.
Date Mon, 02 Jul 2007 19:09:05 GMT

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

stack commented on HADOOP-1375:
-------------------------------

This patch is almost there.   There is just one more thing that I think you need to fix before
commit.  
It should be possible to do a 'select TABLE_NAME where COLUMN='COLNAME'.  This is important
for
the common case where the table is full of crawl data one column of which is the page content,
anothe
 column is crawl metadata etc.  It should be possible to do a select that returns all of the
metadata for all rows
(without return page content). 

Here is what happens when I try to do this now.  First, I display the content of my test table:

{code}
HBase > select z;
+------+----------------------+----------------------+----------------------+
| No.  | Row Key              | ColumnFamily:Column  | Cell Data            | 
+------+----------------------+----------------------+----------------------+
| 1    | a                    | z:                   | a                    |
+------+----------------------+----------------------+----------------------+
| 2    | a                    | z:a                  | a                    |
+------+----------------------+----------------------+----------------------+
| 3    | b                    | z:b                  | b                    |
+------+----------------------+----------------------+----------------------+
| 4    | c                    | z:c                  | c                    |
+------+----------------------+----------------------+----------------------+
| 5    | d                    | x:d                  | d                    |
+------+----------------------+----------------------+----------------------+

Selected data successfully.(0.04 sec)
{code}

Now I try and narrow the select to a particular column:
{code}
HBase > select z where row='a' and columm='z:a';
Exception in thread "main" org.apache.hadoop.hbase.shell.generated.ParseException: Encountered
"columm" at line 1, column 29.
Was expecting one of:
    <ROW> ...
    <COLUMN> ...
    <TIME> ...
    
        at org.apache.hadoop.hbase.shell.generated.Parser.generateParseException(Parser.java:519)
        at org.apache.hadoop.hbase.shell.generated.Parser.jj_consume_token(Parser.java:455)
        at org.apache.hadoop.hbase.shell.generated.Parser.expression(Parser.java:331)
        at org.apache.hadoop.hbase.shell.generated.Parser.WhereClause(Parser.java:309)
        at org.apache.hadoop.hbase.shell.generated.Parser.parse(Parser.java:177)
        at org.apache.hadoop.hbase.shell.HBaseShell.main(HBaseShell.java:61)
{code}

I get same crash if I do 'select z column="z:"'.

Here is another crash that I wasn't able to reproduce  I'd made a table 'x' with a column
family of 'x:'.  I then inserted a row at 'x' with a value of 'x'.  I then managed to crash
the shell with the below:
{code}
HBase > set x where values('x:', 'y') where row='x';
Exception in thread "main" org.apache.hadoop.hbase.shell.generated.ParseException: Encountered
"values" at line 1, column 14.
Was expecting one of:
    <ROW> ...
    <COLUMN> ...
    <TIME> ...
    
        at org.apache.hadoop.hbase.shell.generated.Parser.generateParseException(Parser.java:519)
        at org.apache.hadoop.hbase.shell.generated.Parser.jj_consume_token(Parser.java:455)
        at org.apache.hadoop.hbase.shell.generated.Parser.expression(Parser.java:331)
        at org.apache.hadoop.hbase.shell.generated.Parser.WhereClause(Parser.java:297)
        at org.apache.hadoop.hbase.shell.generated.Parser.parse(Parser.java:177)
        at org.apache.hadoop.hbase.shell.HBaseShell.main(HBaseShell.java:61)
{code}

I like the way you just print out the first line of an exception as in the below where I'd
asked to 'select' against a non-existent table:

{code}
HBase > select tables;
error msg : org.apache.hadoop.hbase.NoServerForRegionException: failed to find server for
tables after 5 retries
{code}

> a simple parser for hbase.
> --------------------------
>
>                 Key: HADOOP-1375
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1375
>             Project: Hadoop
>          Issue Type: Improvement
>          Components: contrib/hbase
>    Affects Versions: 0.13.0
>         Environment: All environments 
>            Reporter: edward yoon
>            Priority: Minor
>             Fix For: 0.14.0
>
>         Attachments: hadoop1375-v12.patch, hbase_shell_base_v03.patch, hbase_shell_base_v04.patch,
jline-0.9.91.jar
>
>
> http://wiki.apache.org/lucene-hadoop/HbaseShell (work in progress)
> HBase Shell is developed to achieve the following goals. 
>  * Generic Monitoring Function 
>  * A Simplified Import/Export/Migrate Functionality Between different data sources (Hadoop,
HBase) 
>  * A Simplified processing of a logical data model 
>  * A Simplified algebraic operations 
>    (Parallel Numerical Analysis by abstracting/numericalizing points, lines, or plane
data across multiple maps in HBase.)
> {code}
> [# root@localhost] ./bin/hadoop jar ./build/hadoop-hbase org.apache.hadoop.hbase.shell.HbaseShell
> Hbase > help;
> blah blah...
> Hbase > create webtable 
>      --> columnfamilies('anchors', 'language') limit=3;
> Hbase > set webtable values('anchors:http://www.udanax.org/','opensource') where row="http://www.hadoop.co.kr";
> Hbase > scan webtable where row="http://www.hadoop.co.kr";
> blah blah...
> Hbase > set webtable values('language:kr','euc-kr') where row="http://www.hadoop.co.kr";
> Hbase > scan webtable where row="http://www.hadoop.co.kr" and column="language:kr";
> blah blah...
> Hbase > scan webtable;
> Hbase > exit
> [# root@localhost] 
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message