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 Fri, 25 May 2007 18:11:16 GMT

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

stack commented on HADOOP-1375:

> and i can't find an API to get row set in table.
> please, advice for me.

In HClient there is the method: 'public HScannerInterface obtainScanner(Text[] columns, Text
startRow)  throws IOException'

Pass a null to scan all rows (Looks like specifying an 'endRow' is missing).

Looking at this more, scanners require that at least one column name is supplied.  There is
no means of obtaining a list of all columns in a table.  So the minimum scan statement would
have to be something like:

HBase> SCAN table_name WHERE column=column_name;

When your parser gets the above, it would presume that all rows are wanted and pass a null
for the startRow to the obtainScanner in your client.

I haven't tried it, but can I do the following?

HBase> SCAN table_name WHERE column=column_name1 AND column=column_name2...

In other words, can I ask for the scan to return more than one column?

Would it be hard to add 'startRow' and 'endRow' handling to your parser so users could get
a scanner over a range?  Something like:

SCAN table_name
WHERE column="columnfamily_name:column_key"
[AND row="row_key" | startRow="startrow_key" [AND endRow="endrow_key"]]
[AND time="Specified_Timestamp"];

In "english", you can specify either an explicit row or you can specify where to start scanning
with an optional endrow for where to stop.

Good stuff Edward

> 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
>         Environment: All environments 
>            Reporter: udanax
>            Priority: Minor
>         Attachments: patch.txt, patch.txt, patch.txt, patch.txt, patch.txt, patch.txt,
patch.txt, patch.txt
> this is a simple parser for hbase test.
> i just write it.
> you can use this syntax to create and set.
> {code}
> [# root@localhost] ./bin/hadoop jar ./build/hadoop-hbase org.apache.hadoop.hbase.parser.HbaseParser
> Hbase > help;
> blah blah...
> Hbase > build 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 > 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.

View raw message