You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gora.apache.org by "Alfonso Nishikawa (JIRA)" <ji...@apache.org> on 2012/11/20 08:24:59 UTC

[jira] [Comment Edited] (GORA-187) gora-hbase always writing column when dirty, even if value is default or null

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

Alfonso Nishikawa edited comment on GORA-187 at 11/20/12 7:23 AM:
------------------------------------------------------------------

Hi, Ferdy.
Currently happens that when you load a row from HBase (you get the instance of the subclass of Persistent) you get a pseudo-"default" (not the default from the .avsc) value for nonexistant columns: 0 for numerics, null for instances like String or other classes.
I notice that if you write back that instance to HBase without touching anything (and strings filled, otherwise will get a NPE), the numerics don't get written. But if you write a 1 and then a 0 in one numeric column, that column gets written.

I expect:
- Only write nondefault values, so saves space and allows a way to delete a column in HBase related to the Persistent class.
- Delete a column when dirty and default value (so changed to the default).
- When reading from HBase, load the default value if the column does not exist.

I think this is a good aproach transparent to the other backends, without having to create new methods in Persistent to delete columns, etc...
Maybe this should go in the "Description" :P
Thanks for your question (very productive!). If this is not enough clear, ask and I will explain more :)
                
      was (Author: alfonso.nishikawa):
    Hi, Ferdy.
Currently happens that when you load a row from HBase (you get the instance of the subclass of Persistent) you get a pseudo-"default" (not the default from the .avsc) value for nonexistant columns: 0 for numerics, null for instances like String or other classes.
I notice that if you write back that instance to HBase without touching anything (and strings filled, otherwise will get a NPE), the numerics don't get written. But if you write a 1 and then a 0 in one numeric column, that column gets written.

I expect:
- Only write nondefault values, so saves space and allows a way to delete a column in HBase related to the Persistent class.
- Delete a column when dirty and default value (so changed to the default).
- When reading from HBase, load the default value if the columns does not exists.

I think this is a good aproach transparent to the other backends, without having to create new methods in Persistent to delete columns, etc...
Maybe this should go in the "Description" :P
Thanks for your question (very productive!). If this is not enough clear, ask and I will explain more :)
                  
> gora-hbase always writing column when dirty, even if value is default or null
> -----------------------------------------------------------------------------
>
>                 Key: GORA-187
>                 URL: https://issues.apache.org/jira/browse/GORA-187
>             Project: Apache Gora
>          Issue Type: Improvement
>          Components: storage-hbase
>    Affects Versions: 0.2.1
>         Environment: Ubuntu 12.04, HBase 0.92.0
>            Reporter: Alfonso Nishikawa
>            Priority: Minor
>
> When writing a field (tested with 'long' default '0'), if it is not dirty when saving, will not write the column. If setted to 1 and back to 0, saving will write that default value.
> With strings, after fixing [GORA-183], noticed that null values are too written (being default or not).

--
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