hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Purtell <andrew.purt...@gmail.com>
Subject Re: REST Interface: Required ordering of JSON name/value pairs when performing Insert/Update
Date Mon, 04 Jun 2012 15:28:08 GMT
It's a bad bug in that it's a silent corruption, so even if use of REST+JSON isn't common it
should be fixed soon. A quick patch that rejects empty values is a start. Will add a "no I
really mean it" flag. This would address 0.92 and 0.94. Then we switch to Jackson and a new
JSON representation in 0.96. Sound reasonable?

    - Andy

On Jun 4, 2012, at 5:20 PM, Nick Dimiduk <ndimiduk@gmail.com> wrote:

> Andy,
> 
> Thanks for the follow-up. For what it's worth, I've been bitten by this
> "feature" by two separate projects this month. The only reason I thought to
> check field order was because it looked strikingly familiar.
> 
> This is not a blocking issue for me, please prioritize accordingly. If no
> one else has noticed in 2 years, a documentation is more than sufficient.
> 
> -n
> 
> On Sun, Jun 3, 2012 at 2:54 PM, Andrew Purtell <apurtell@apache.org> wrote:
> 
>> On Jun 3, 2012, at 11:51 AM, Nick Dimiduk <ndimiduk@gmail.com> wrote:
>>> When I:
>>> 
>>> $ curl -v -XPUT \
>>> -H "Content-Type: application/json" \
>>> http://localhost:9999/users/TheRealMT/info:password \
>>> -d '{
>>>   "Row": [
>>>       {
>>>           "Cell": [
>>>               {
>>> *                    "@column": "aW5mbzpwYXNzd29yZA==",*
>>> *                    "$": "NzBOQHJJIE4wIDcwdDBSMA=="*
>>>               }
>>>           ],
>>>           "@key": "VGhlUmVhbE1U"
>>>       }
>>>   ]
>>> }'
>>> 
>>> The logs show:
>>> 
>>> 12/06/03 02:43:16 DEBUG rest.RowResource: PUT
>>> http://localhost:9999/users/TheRealMT/info:password
>>> 12/06/03 02:43:16 DEBUG rest.RowResource: PUT
>>> 
>> {"totalColumns":1,"families":{"info":[{"timestamp":9223372036854775807,"qualifier":"password",
>>> *"vlen":16*}]},"row":"TheRealMT"}
>>> 
>>> And the write is successful.
>>> 
>>> But if I:
>>> 
>>> $ curl -v -XPUT \
>>> -H "Content-Type: application/json" \
>>> http://localhost:9999/users/TheRealMT/info:password \
>>> -d '{
>>>   "Row": [
>>>       {
>>>           "Cell": [
>>>               {
>>> *                    "$": "NzBOQHJJIE4wIDcwdDBSMA==",*
>>> *                    "@column": "aW5mbzpwYXNzd29yZA=="*
>>>               }
>>>           ],
>>>           "@key": "VGhlUmVhbE1U"
>>>       }
>>>   ]
>>> }'
>>> 
>>> The log shows:
>>> 
>>> 12/06/03 02:46:22 DEBUG rest.RowResource: PUT
>>>> http://localhost:9999/users/TheRealMT/info:password
>>> 12/06/03 02:46:22 DEBUG rest.RowResource: PUT
>>> 
>> {"totalColumns":1,"families":{"info":[{"timestamp":9223372036854775807,"qualifier":"password",
>>> *"vlen":0*}]},"row":"TheRealMT"}
>> 
>> See
>> https://issues.apache.org/jira/browse/HBASE-2475?focusedCommentId=13288259&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13288259
>> 
>> and
>> https://issues.apache.org/jira/browse/HBASE-2475?focusedCommentId=13288265&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13288265
>> 
>> Perhaps it's worth proceeding even though the JSON input and output of
>> HBase REST will most likely change? (And change to something cleaner
>> and saner.)
>> 
>> We don't use the REST gateway ourselves but when we were looking at it
>> once, I recommended using the protobuf representation option.
>> 
>>   - Andy
>> 

Mime
View raw message