hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Purtell <apurt...@apache.org>
Subject Re: Cannot create table over REST
Date Wed, 14 Sep 2011 04:47:30 GMT
Hi Karel,

> The REST docs are not very clear then -- I've copied over the JSON from `GET /table/schema`
example

Noted, thanks.


Please see https://issues.apache.org/jira/browse/HBASE-4399

 

Best regards,


       - Andy

Problems worthy of attack prove their worth by hitting back. - Piet Hein (via Tom White)


>________________________________
>From: Karel Minařík <karel.minarik@gmail.com>
>To: user@hbase.apache.org
>Sent: Tuesday, September 13, 2011 9:33 PM
>Subject: Re: Cannot create table over REST
>
>Thanks, Andy! I see I've had one more `@` in the column "name" property? 
>
>The REST docs are not very clear then -- I've copied over the JSON from `GET /table/schema`
example (which contains `@name`, not `name` in the column definition). I think adding examples
for creating tables (and rows, for that matter), would be very handy.
>
>Karel
>
>On 14.Sep, 2011, at 1:11 , Andrew Purtell wrote:
>
>> Try
>> 
>> curl -v -X PUT \
>> 
>>  http://localhost:8080/test/schema \
>>   -H "Accept: application/json" \
>>   -H "Content-Type: application/json" \
>>   -d '{"name":"test","ColumnSchema":[{"name":"data"}]}'
>> 
>>  
>> You should see:
>> 
>>> PUT /test/schema HTTP/1.1
>>> User-Agent: curl/7.21.3 (x86_64-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4
libidn/1.18
>>> Host: localhost:8080
>>> Accept: application/json
>>> Content-Type: application/json
>>> Content-Length: 48
>>> 
>> < HTTP/1.1 201 Created
>> < Location: http://localhost:8085/test/schema
>> < Content-Length: 0
>> 
>> 
>> Best regards,
>> 
>> 
>> - Andy
>> 
>> 
>> Problems worthy of attack prove their worth by hitting back. - Piet Hein (via Tom
White)
>> 
>> 
>> ----- Original Message -----
>>> From: Karel Minařík <karel.minarik@gmail.com>
>>> To: user@hbase.apache.org
>>> Cc: 
>>> Sent: Tuesday, September 13, 2011 1:15 PM
>>> Subject: Cannot create table over REST
>>> 
>>> Hi,
>>> 
>>> when I try to create a table via the REST interface:
>>> 
>>> curl -v -X PUT \
>>>   'http://localhost:8080/test/schema' \
>>>   -H "Accept: application/json" \
>>>   -H "Content-Type: application/json" \
>>>   -d 
>>> '{"@name":"test","ColumnSchema":[{"@name":"data"}]}'
>>> 
>>> I get an exception:
>>> 
>>> Sep 13, 2011 10:11:47 PM com.sun.jersey.spi.container.ContainerResponse 
>>> mapMappableContainerException
>>> SEVERE: The RuntimeException could not be mapped to a response, re-throwing to

>>> the HTTP container
>>> java.lang.NullPointerException
>>>     at org.apache.hadoop.hbase.util.Bytes.toBytes(Bytes.java:401)
>>> 
>>> What I'm doing wrong?
>>> 
>>> Thanks!,
>>> 
>>> Karel
>>> 
>
>
>
>
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message