You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Ryan Lynch (JIRA)" <ji...@apache.org> on 2008/05/21 07:30:56 UTC
[jira] Created: (HBASE-631) HTable.getRow() for only a column
family
HTable.getRow() for only a column family
----------------------------------------
Key: HBASE-631
URL: https://issues.apache.org/jira/browse/HBASE-631
Project: Hadoop HBase
Issue Type: New Feature
Affects Versions: 0.1.2
Reporter: Ryan Lynch
I have a use case in which we want to access all the columns for a supplied column family while also avoiding the overhead of reading any other column families. There seems to be no method for doing this but doing a quick dive into the code it "seems" like this should be relatively easy to allow. This seems desirable since the architecture describes column families being stored together so reading only a single column family should be a lighter operation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (HBASE-631) HTable.getRow() for only a column
family
Posted by "stack (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-631?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
stack resolved HBASE-631.
-------------------------
Resolution: Fixed
Fix Version/s: 0.2.0
Committed with below small change. Thanks for the patch J-D!
{code}
+ if (HStoreKey.getFamilyDelimiterIndex(bs) == (bs.length - 1)) {
{code}
I used above to figure if column family only rather than create a new String and use String index.
> HTable.getRow() for only a column family
> ----------------------------------------
>
> Key: HBASE-631
> URL: https://issues.apache.org/jira/browse/HBASE-631
> Project: Hadoop HBase
> Issue Type: New Feature
> Affects Versions: 0.1.2
> Reporter: Ryan Lynch
> Assignee: Jean-Daniel Cryans
> Fix For: 0.2.0
>
> Attachments: hbase-631-v1.patch
>
>
> I have a use case in which we want to access all the columns for a supplied column family while also avoiding the overhead of reading any other column families. There seems to be no method for doing this but doing a quick dive into the code it "seems" like this should be relatively easy to allow. This seems desirable since the architecture describes column families being stored together so reading only a single column family should be a lighter operation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (HBASE-631) HTable.getRow() for only a column
family
Posted by "Jean-Daniel Cryans (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-631?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jean-Daniel Cryans reassigned HBASE-631:
----------------------------------------
Assignee: Jean-Daniel Cryans
> HTable.getRow() for only a column family
> ----------------------------------------
>
> Key: HBASE-631
> URL: https://issues.apache.org/jira/browse/HBASE-631
> Project: Hadoop HBase
> Issue Type: New Feature
> Affects Versions: 0.1.2
> Reporter: Ryan Lynch
> Assignee: Jean-Daniel Cryans
>
> I have a use case in which we want to access all the columns for a supplied column family while also avoiding the overhead of reading any other column families. There seems to be no method for doing this but doing a quick dive into the code it "seems" like this should be relatively easy to allow. This seems desirable since the architecture describes column families being stored together so reading only a single column family should be a lighter operation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HBASE-631) HTable.getRow() for only a column
family
Posted by "Jean-Daniel Cryans (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-631?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jean-Daniel Cryans updated HBASE-631:
-------------------------------------
Attachment: hbase-631-v1.patch
Small patch that adds family fetching for getRow. Review please.
> HTable.getRow() for only a column family
> ----------------------------------------
>
> Key: HBASE-631
> URL: https://issues.apache.org/jira/browse/HBASE-631
> Project: Hadoop HBase
> Issue Type: New Feature
> Affects Versions: 0.1.2
> Reporter: Ryan Lynch
> Assignee: Jean-Daniel Cryans
> Attachments: hbase-631-v1.patch
>
>
> I have a use case in which we want to access all the columns for a supplied column family while also avoiding the overhead of reading any other column families. There seems to be no method for doing this but doing a quick dive into the code it "seems" like this should be relatively easy to allow. This seems desirable since the architecture describes column families being stored together so reading only a single column family should be a lighter operation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-631) HTable.getRow() for only a column
family
Posted by "Jean-Daniel Cryans (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12611404#action_12611404 ]
Jean-Daniel Cryans commented on HBASE-631:
------------------------------------------
{quote}
+ So, if a user adds a cell at row/columnfamily name - i.e. if row is x and column family is y:, at x/y: - they can use get to extract that explicit cell but if they use x/y: with getFull/getRow, the behavior will be different; instead they will get the explicit x/y: cell AND all other cells that might on the 'y:' column family such y:1, y:2, etc. I think this is OK.
{quote}
I think that mixing cells in row/columnfamily and row/columnfamily:key in a same family is bad design choice but yes, getRow would fetch everything. In fact, I didn't think about this situation so thanks for pointing out! I guess I will update the comments.
Regards the code snippet, there may be more than one family specified (I know, only one was asked but it was easier permitting many families) so I guess I will leave it like that.
Thanks for the review stack!
> HTable.getRow() for only a column family
> ----------------------------------------
>
> Key: HBASE-631
> URL: https://issues.apache.org/jira/browse/HBASE-631
> Project: Hadoop HBase
> Issue Type: New Feature
> Affects Versions: 0.1.2
> Reporter: Ryan Lynch
> Assignee: Jean-Daniel Cryans
> Attachments: hbase-631-v1.patch
>
>
> I have a use case in which we want to access all the columns for a supplied column family while also avoiding the overhead of reading any other column families. There seems to be no method for doing this but doing a quick dive into the code it "seems" like this should be relatively easy to allow. This seems desirable since the architecture describes column families being stored together so reading only a single column family should be a lighter operation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HBASE-631) HTable.getRow() for only a column
family
Posted by "stack (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HBASE-631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12611386#action_12611386 ]
stack commented on HBASE-631:
-----------------------------
Patch looks good (especially the unit test additions).
Couple of comments/questions:
+ So, if a user adds a cell at row/columnfamily name -- i.e. if row is x and column family is y:, at x/y: -- they can use get to extract that explicit cell but if they use x/y: with getFull/getRow, the behavior will be different; instead they will get the explicit x/y: cell AND all other cells that might on the 'y:' column family such y:1, y:2, etc. I think this is OK.
+ I was wondering if the code below:
{code}
+ if(columns != null) {
+ for (byte[] bs : columns) {
+ if(Bytes.toString(bs).split(":").length == 1) {
+ HStore store = stores.get(Bytes.mapKey(HStoreKey.getFamily(bs)));
+ store.getFull(key, null, result);
+ }
+ }
{code}
...should be integrated with the code above it? If only a column family specified, pass null to the store.getFull?
> HTable.getRow() for only a column family
> ----------------------------------------
>
> Key: HBASE-631
> URL: https://issues.apache.org/jira/browse/HBASE-631
> Project: Hadoop HBase
> Issue Type: New Feature
> Affects Versions: 0.1.2
> Reporter: Ryan Lynch
> Assignee: Jean-Daniel Cryans
> Attachments: hbase-631-v1.patch
>
>
> I have a use case in which we want to access all the columns for a supplied column family while also avoiding the overhead of reading any other column families. There seems to be no method for doing this but doing a quick dive into the code it "seems" like this should be relatively easy to allow. This seems desirable since the architecture describes column families being stored together so reading only a single column family should be a lighter operation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.