phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Taylor <jamestay...@apache.org>
Subject Re: Question on Binary indexes
Date Fri, 28 Mar 2014 17:23:28 GMT
One option would be to base64 encode your fixed length binary as a String.
Then store it that way in Phoenix and you'd be able to index it.

It's possible that we could encode binary data in a way that would let us
index it - how about filing a JIRA for that?

Thanks,
James


On Fri, Mar 28, 2014 at 3:09 AM, Dan Di Spaltro <dan.dispaltro@gmail.com>wrote:

> So James' ticket seems to indicate this is intended behavior, have you
> resolved that?  It seems like an index on arbitrarily fixed-with bytes
> aren't a bad thing.
>
>
> On Wed, Mar 26, 2014 at 3:49 PM, Samarth Jain <samarth.jain@gmail.com>wrote:
>
>> Hi Dan,
>>
>> Thanks for reporting.
>>
>> I am working on a fix for this. Please see:
>> https://issues.apache.org/jira/browse/PHOENIX-899
>>
>> Thanks,
>> Samarth
>>
>>
>>
>> On Wed, Mar 26, 2014 at 3:42 PM, Dan Di Spaltro <dan.dispaltro@gmail.com>wrote:
>>
>>> I have a table with two indexes
>>>
>>> create table auth.account_users
>>>     (
>>>     ordered_id BINARY(16) not null PRIMARY KEY,
>>>     account_id BINARY(16) not null,
>>>     user_id BINARY(16) not null,
>>>     default BOOLEAN,
>>>     created_at TIMESTAMP
>>>     ) VERSIONS=1,IMMUTABLE_ROWS=true
>>>
>>>
>>> CREATE INDEX auth_account_users_user_idx ON auth.account_users(user_id)
>>>
>>> CREATE INDEX auth_account_users_account_idx ON
>>> auth.account_users(account_id)
>>>
>>> The creation works fine on this but during insert I get the following
>>> message, I am wondering is this intended?  Judging by the code it should
>>> work... I am using the 4.0 RC btw.
>>>
>>> java.lang.IllegalArgumentException: Unsupported non nullable index type
>>> BINARY
>>> at
>>> org.apache.phoenix.util.IndexUtil.getIndexColumnDataType(IndexUtil.java:81)
>>>  at
>>> org.apache.phoenix.index.IndexMaintainer.buildRowKey(IndexMaintainer.java:345)
>>> at
>>> org.apache.phoenix.index.IndexMaintainer.buildUpdateMutation(IndexMaintainer.java:391)
>>>  at
>>> org.apache.phoenix.util.IndexUtil.generateIndexData(IndexUtil.java:185)
>>> at
>>> org.apache.phoenix.execute.MutationState$1.next(MutationState.java:203)
>>>  at
>>> org.apache.phoenix.execute.MutationState$1.next(MutationState.java:186)
>>> at
>>> org.apache.phoenix.execute.MutationState.commit(MutationState.java:347)
>>>  at
>>> org.apache.phoenix.jdbc.PhoenixConnection.commit(PhoenixConnection.java:351)
>>> at
>>> org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:229)
>>>  at
>>> org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:185)
>>> at
>>> org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:146)
>>>  at
>>> org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:151)
>>>
>>> --
>>> Dan Di Spaltro
>>>
>>
>>
>
>
> --
> Dan Di Spaltro
>

Mime
View raw message