Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
HBase >> mail # dev >> Re: REST Interface: Required ordering of JSON name/value pairs when performing Insert/Update


+
Andrew Purtell 2012-06-03, 21:54
Copy link to this message
-
Re: REST Interface: Required ordering of JSON name/value pairs when performing Insert/Update
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 <[EMAIL PROTECTED]> wrote:

> On Jun 3, 2012, at 11:51 AM, Nick Dimiduk <[EMAIL PROTECTED]> 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
>
+
Andrew Purtell 2012-06-04, 15:28