[ 
https://issues.apache.org/jira/browse/PHOENIX-1514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14241573#comment-14241573
 ] 

Nick Dimiduk commented on PHOENIX-1514:
---------------------------------------

[~jeffreyz]

{quote}
A user can possible define a table with something like below:

CREATE TABLE my_schema.my_table ( id BIGINT:<my custom type implementation> , 
date DATE:<my custom type implementation> not null)
{quote}

That's exactly the direction I'm thinking. Since becoming more familiar with 
the code, one thing I've though about is replacing all uses of, for example, 
Varchar.INSTANCE, with PDataTypeFactory.getType("VARCHAR", mySchema). That way 
we can allow tables to override their encoder definitions on a case-by-case 
basis.

[~jamestaylor]

bq. Not so sure we want to change our SQL dialect to support a type system that 
we want to deprecate, though.

Ignoring for a moment the applicability of OrderedBytes for Phoenix's use, 
Jeffrey's suggestion allows users to plug in arbitrary type encoding 
implementations, just like they might define a new stored procedure. I think 
this will be incredibly powerful. This patch doesn't go that far, all I'm doing 
is opening the door to more options.

bq. There'd be some work required in the RowKeySchema and RowKeyValueAccessor 
(though this one could go through RowKeySchema instead so that everything is 
isolated there). The RowKeySchema class is more or less like your 
StructIterator (if I remember your class names correctly).

I haven't looked into handling row keys yet, that will be next on my list.

The other thing I haven't though about yet is how to implement types that span 
row key/column. For example, I want to query the timestamp of an OpenTSDB 
event, I need to bring together the time bucket from the row key with the 
measurement resolution from the qualifier. Neither HBase's DataType nor 
Phoenix's PDataType allow for this concept. Best I can think of would be a 
Phoenix view on top of the raw schema that does the last bit of work required 
in joining bits.

Now let me address your review comments. Is there no Jenkins/BuildBot over here?

> Break up PDataType Enum
> -----------------------
>
>                 Key: PHOENIX-1514
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1514
>             Project: Phoenix
>          Issue Type: Sub-task
>    Affects Versions: 5.0.0
>            Reporter: Nick Dimiduk
>            Assignee: Nick Dimiduk
>             Fix For: 5.0.0
>
>         Attachments: PHOENIX-1514.00.patch
>
>
> A first step in adopting (a portion of) HBase's type encodings is to break up 
> the PDataType enum into an interface. This will pave the way for more 
> flexibility going forward.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to