You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Clint Morgan (JIRA)" <ji...@apache.org> on 2008/06/03 20:24:44 UTC

[jira] Created: (HBASE-661) Allow to specify a user supplied row key comparator for a table

Allow to specify a user supplied row key comparator for a table 
----------------------------------------------------------------

                 Key: HBASE-661
                 URL: https://issues.apache.org/jira/browse/HBASE-661
             Project: Hadoop HBase
          Issue Type: New Feature
          Components: client, master, regionserver
    Affects Versions: 0.2.0
            Reporter: Clint Morgan


Now that row keys are byte arrays, users should be able to specify a comparator at table creation time.

My use case for this is to implement secondary indexes. In this case, row keys for the index tables will be constructed from an optional prefix of the original row key as well as the content of column that is being indexed. Then the comparator will first compare based on the key prefix, and break ties by deserializing the column values and using the deserialized type's compareTo method.


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


[jira] Commented: (HBASE-661) Allow to specify a user supplied row key comparator for a table

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629923#action_12629923 ] 

stack commented on HBASE-661:
-----------------------------

Clint: I'd suggest you become a watcher on HBASE-880 and HBASE-849 so you can keep an eye on progress and ensure your needs are covered.

> Allow to specify a user supplied row key comparator for a table 
> ----------------------------------------------------------------
>
>                 Key: HBASE-661
>                 URL: https://issues.apache.org/jira/browse/HBASE-661
>             Project: Hadoop HBase
>          Issue Type: New Feature
>          Components: client, master, regionserver
>    Affects Versions: 0.2.0
>            Reporter: Clint Morgan
>            Assignee: Clint Morgan
>
> Now that row keys are byte arrays, users should be able to specify a comparator at table creation time.
> My use case for this is to implement secondary indexes. In this case, row keys for the index tables will be constructed from an optional prefix of the original row key as well as the content of column that is being indexed. Then the comparator will first compare based on the key prefix, and break ties by deserializing the column values and using the deserialized type's compareTo method.

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


[jira] Commented: (HBASE-661) Allow to specify a user supplied row key comparator for a table

Posted by "Alex Newman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731724#action_12731724 ] 

Alex Newman commented on HBASE-661:
-----------------------------------

Does this mean this is no longer blocked?

> Allow to specify a user supplied row key comparator for a table 
> ----------------------------------------------------------------
>
>                 Key: HBASE-661
>                 URL: https://issues.apache.org/jira/browse/HBASE-661
>             Project: Hadoop HBase
>          Issue Type: New Feature
>          Components: client, master, regionserver
>    Affects Versions: 0.2.0
>            Reporter: Clint Morgan
>            Assignee: Clint Morgan
>
> Now that row keys are byte arrays, users should be able to specify a comparator at table creation time.
> My use case for this is to implement secondary indexes. In this case, row keys for the index tables will be constructed from an optional prefix of the original row key as well as the content of column that is being indexed. Then the comparator will first compare based on the key prefix, and break ties by deserializing the column values and using the deserialized type's compareTo method.

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


[jira] Commented: (HBASE-661) Allow to specify a user supplied row key comparator for a table

Posted by "Clint Morgan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629639#action_12629639 ] 

Clint Morgan commented on HBASE-661:
------------------------------------

This seems easy enough at first glance. Just associate an (optional) WritableCompartor<byte[]> with each table. If a table has this comparator then use it (this logic seems to belong in the new HStoreKey.compareTwoRowKeys).

Things get more tricky I think when taking the META table into account. I suppose I need to rework the way META rows are being compared to use the tables comparator for the row's bits in each meta key.

So If I have two tables A, and B with 2 regions each, and B has a custom, reverse, comparator, then I want a META laid out like:

A,1,5
A,5,
B,9,5
B,5,

So basically the META table uses a custom comparator that is composed of the comparators for each Table.

Any advice before I start digging deeper? Are there many places where we assume that row keys are lexocographiclly sorted?

> Allow to specify a user supplied row key comparator for a table 
> ----------------------------------------------------------------
>
>                 Key: HBASE-661
>                 URL: https://issues.apache.org/jira/browse/HBASE-661
>             Project: Hadoop HBase
>          Issue Type: New Feature
>          Components: client, master, regionserver
>    Affects Versions: 0.2.0
>            Reporter: Clint Morgan
>            Assignee: Clint Morgan
>
> Now that row keys are byte arrays, users should be able to specify a comparator at table creation time.
> My use case for this is to implement secondary indexes. In this case, row keys for the index tables will be constructed from an optional prefix of the original row key as well as the content of column that is being indexed. Then the comparator will first compare based on the key prefix, and break ties by deserializing the column values and using the deserialized type's compareTo method.

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


[jira] Commented: (HBASE-661) Allow to specify a user supplied row key comparator for a table

Posted by "Clint Morgan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629831#action_12629831 ] 

Clint Morgan commented on HBASE-661:
------------------------------------

Thanks, 

In that case I'll wait until after the overhaul to revisit this.

> Allow to specify a user supplied row key comparator for a table 
> ----------------------------------------------------------------
>
>                 Key: HBASE-661
>                 URL: https://issues.apache.org/jira/browse/HBASE-661
>             Project: Hadoop HBase
>          Issue Type: New Feature
>          Components: client, master, regionserver
>    Affects Versions: 0.2.0
>            Reporter: Clint Morgan
>            Assignee: Clint Morgan
>
> Now that row keys are byte arrays, users should be able to specify a comparator at table creation time.
> My use case for this is to implement secondary indexes. In this case, row keys for the index tables will be constructed from an optional prefix of the original row key as well as the content of column that is being indexed. Then the comparator will first compare based on the key prefix, and break ties by deserializing the column values and using the deserialized type's compareTo method.

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


[jira] Assigned: (HBASE-661) Allow to specify a user supplied row key comparator for a table

Posted by "Clint Morgan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-661?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clint Morgan reassigned HBASE-661:
----------------------------------

    Assignee: Clint Morgan

> Allow to specify a user supplied row key comparator for a table 
> ----------------------------------------------------------------
>
>                 Key: HBASE-661
>                 URL: https://issues.apache.org/jira/browse/HBASE-661
>             Project: Hadoop HBase
>          Issue Type: New Feature
>          Components: client, master, regionserver
>    Affects Versions: 0.2.0
>            Reporter: Clint Morgan
>            Assignee: Clint Morgan
>
> Now that row keys are byte arrays, users should be able to specify a comparator at table creation time.
> My use case for this is to implement secondary indexes. In this case, row keys for the index tables will be constructed from an optional prefix of the original row key as well as the content of column that is being indexed. Then the comparator will first compare based on the key prefix, and break ties by deserializing the column values and using the deserialized type's compareTo method.

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


[jira] Commented: (HBASE-661) Allow to specify a user supplied row key comparator for a table

Posted by "Jonathan Gray (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629645#action_12629645 ] 

Jonathan Gray commented on HBASE-661:
-------------------------------------

Clint,

Check out HBASE-832, HBASE-868, and HBASE-877.  These all deal directly with comparators and rows in the meta table.

There's a consensus after dealing with these issues that we'll be doing an overhaul of some kind of the comparators associated with each region.

I imagine this issue would be solved along with that change.

> Allow to specify a user supplied row key comparator for a table 
> ----------------------------------------------------------------
>
>                 Key: HBASE-661
>                 URL: https://issues.apache.org/jira/browse/HBASE-661
>             Project: Hadoop HBase
>          Issue Type: New Feature
>          Components: client, master, regionserver
>    Affects Versions: 0.2.0
>            Reporter: Clint Morgan
>            Assignee: Clint Morgan
>
> Now that row keys are byte arrays, users should be able to specify a comparator at table creation time.
> My use case for this is to implement secondary indexes. In this case, row keys for the index tables will be constructed from an optional prefix of the original row key as well as the content of column that is being indexed. Then the comparator will first compare based on the key prefix, and break ties by deserializing the column values and using the deserialized type's compareTo method.

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


[jira] Commented: (HBASE-661) Allow to specify a user supplied row key comparator for a table

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731771#action_12731771 ] 

stack commented on HBASE-661:
-----------------------------

A comparator per table will not be happening anytime soon.  Can't have one comparator per table.  When they all meet in the .META. if different comparators, it'll be hard to manage.

> Allow to specify a user supplied row key comparator for a table 
> ----------------------------------------------------------------
>
>                 Key: HBASE-661
>                 URL: https://issues.apache.org/jira/browse/HBASE-661
>             Project: Hadoop HBase
>          Issue Type: New Feature
>          Components: client, master, regionserver
>    Affects Versions: 0.2.0
>            Reporter: Clint Morgan
>            Assignee: Clint Morgan
>
> Now that row keys are byte arrays, users should be able to specify a comparator at table creation time.
> My use case for this is to implement secondary indexes. In this case, row keys for the index tables will be constructed from an optional prefix of the original row key as well as the content of column that is being indexed. Then the comparator will first compare based on the key prefix, and break ties by deserializing the column values and using the deserialized type's compareTo method.

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