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

Paweł Rychlik commented on CASSANDRA-12371:
-------------------------------------------

[~thobbs] I'm looking at jenkins reports, but I'm not sure what to make out of 
it :) Some builds are green, some aborted, and most of them yellow with random 
(?) test failures. I have a feeling that the failures have very little to do 
with tiny&smallints in json, but I only checked out the cassandra repo 
yesterday, so that's pretty much my whole knowledge of the codebase ;).

> INSERT JSON - numbers not accepted for smallint and tinyint
> -----------------------------------------------------------
>
>                 Key: CASSANDRA-12371
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12371
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL
>         Environment: Apache Cassandra 3.7 (provisioned by instaclustr.com, 
> running on AWS)
>            Reporter: Paweł Rychlik
>            Priority: Minor
>              Labels: lhf
>             Fix For: 2.2.x, 3.0.x, 3.x
>
>         Attachments: 12371-2.2.txt
>
>
> Contrary to what is written down on 
> http://cassandra.apache.org/doc/latest/cql/json.html#json-encoding-of-cassandra-data-types,
>  numbers are not an accepted format for tinyints and smallints.
> Steps to reproduce on CQLSH:
> > create table default.test(id text PRIMARY KEY, small smallint, tiny 
> > tinyint);
> > INSERT INTO default.test JSON '{"id":"123","small":11}';
> InvalidRequest: Error from server: code=2200 [Invalid query] message="Error 
> decoding JSON value for small: Expected a short value, but got a Integer: 11"
> > INSERT INTO default.test JSON '{"id":"123","tiny":11}';
> InvalidRequest: Error from server: code=2200 [Invalid query] message="Error 
> decoding JSON value for tiny: Expected a byte value, but got a Integer: 11"
> The good news is that when you wrap the numeric values into strings - it 
> works like a charm.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to