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

Nick Dimiduk commented on HBASE-8693:
-------------------------------------

Hi [~giacomotaylor],

I'm assuming Phoenix intends to use the provided {{Struct}} and 
{{StructIterator}} implementations.

In the case of reading a written value, a call to 
{{Struct#decode(PositionedByteRange)}} will return the decoded {{Object[]}}. If 
you've previously stripped off null columns or you've extended your schema 
since the data was written, the resulting array will be shorter than your 
schema demands. In this case, it should be a simple check of the length of the 
decoded {{Object[]}} and act accordingly.

The case of writing a value, your scenario is almost supported, except for this 
silly little 
[{{assert}}|https://github.com/apache/hbase/blob/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/types/Struct.java#L158].
 To support writing fewer members than are defined in the {{Struct}} 
definition, this needs changed to

{noformat}
assert fields.length >= val.length;
{noformat}

Does that sound about right to you?
                
> DataType: provide extensible type API
> -------------------------------------
>
>                 Key: HBASE-8693
>                 URL: https://issues.apache.org/jira/browse/HBASE-8693
>             Project: HBase
>          Issue Type: Sub-task
>          Components: Client
>            Reporter: Nick Dimiduk
>            Assignee: Nick Dimiduk
>            Priority: Blocker
>             Fix For: 0.98.0, 0.95.2
>
>         Attachments: 0001-HBASE-8693-Extensible-data-types-API.patch, 
> 0001-HBASE-8693-Extensible-data-types-API.patch, 
> 0001-HBASE-8693-Extensible-data-types-API.patch, 
> 0001-HBASE-8693-Extensible-data-types-API.patch, 
> 0001-HBASE-8693-Extensible-data-types-API.patch, 
> 0001-HBASE-8693-Extensible-data-types-API.patch, 
> 0001-HBASE-8693-Extensible-data-types-API.patch, 
> 0001-HBASE-8693-Extensible-data-types-API.patch, 
> 0001-HBASE-8693-Extensible-data-types-API.patch, 
> 0001-HBASE-8693-Extensible-data-types-API.patch, 
> 0001-HBASE-8693-Extensible-data-types-API.patch, 
> 0001-HBASE-8693-Extensible-data-types-API.patch, 
> 0002-HBASE-8693-example-Use-DataType-API-to-build-regionN.patch, 
> KijiFormattedEntityId.java
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to