hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Elser <els...@apache.org>
Subject Re: HBase - REST API - Table Schema PUT vs POST
Date Mon, 14 May 2018 18:37:57 GMT
Yep, you got it :)

Easy doc fix we can get in place.

On 5/14/18 2:25 PM, Kevin Risden wrote:
> Looks like this might have triggered
> https://issues.apache.org/jira/browse/HBASE-20581
> 
> Kevin Risden
> 
> On Mon, May 14, 2018 at 8:46 AM, Kevin Risden <krisden@apache.org> wrote:
> 
>> We are using HDP 2.5 with HBase 1.2.x. We think we found that the PUT vs
>> POST documentation on the HBase book [1] website is incorrect.
>>
>> POST - Create a new table, or replace an existing table’s schema
>>> PUT - Update an existing table with the provided schema fragment
>>
>>
>> This contradicts what is in the original HBase 1.2 API javadocs [2].
>>
>> PUT /<table>/schema
>>> POST /<table>/schema
>>> Uploads table schema. PUT or POST creates table as necessary. PUT fully
>>> replaces schema. POST modifies schema (add or modify column family). Supply
>>> the full table schema for PUT or a well formed schema fragment for POST in
>>> the desired encoding. Set Content-Type header to text/xml if the desired
>>> encoding is XML. Set Content-Type header to application/json if the desired
>>> encoding is JSON. Set Content-Type header to application/x-protobuf if the
>>> desired encoding is protobufs. If not successful, returns appropriate HTTP
>>> error status code. If successful, returns HTTP 200 status.
>>
>>
>> The result of the two conflicting documentation pages is that PUT either
>> updates or replaces and POST either updates or replaces the table schema.
>> This can cause problems like setting the table max versions back to the
>> default of 1.
>>
>> Does this make sense? Is it possible the documentation is incorrect here?
>>
>> The newest versions of HBase apidocs point to the HBase book. I have not
>> checked if the behavior changed between HBase versions.
>>
>> 1. https://hbase.apache.org/book.html#_rest
>> 2. https://hbase.apache.org/1.2/apidocs/org/apache/hadoop/
>> hbase/rest/package-summary.html#operation_create_schema
>>
>> Kevin Risden
>>
> 

Mime
View raw message