You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Alex Cruise (JIRA)" <ji...@apache.org> on 2013/09/11 01:05:52 UTC
[jira] [Created] (CASSANDRA-6003) CQL: Support NaN and inifinities
in Double literals
Alex Cruise created CASSANDRA-6003:
--------------------------------------
Summary: CQL: Support NaN and inifinities in Double literals
Key: CASSANDRA-6003
URL: https://issues.apache.org/jira/browse/CASSANDRA-6003
Project: Cassandra
Issue Type: Wish
Components: Core
Reporter: Alex Cruise
My actual app uses a Map[UUID, Double], and in the upstream data source, unavailable data is encoded as Double.NaN. But when I try to insert them into C* (currently working with 2.0), I get a "no viable alternative" at the syntax immediately following the NaN value.
Here's a tiny test case:
{code}
cqlsh> create table test (pk timeuuid primary key, d double);
cqlsh> insert into test (pk, d) values (now(), NaN);
Bad Request: line 1:43 no viable alternative at input ')'
{code}
The workaround suggested by 'iamaleksey' on IRC (Thanks!) allows the data to be inserted, but it's really ugly, and I'm not sure yet whether it will work OK on the read side:
{code}
// myStuff is a Map[UUID,Double]
mySuff.mapValues {
case x if x.isNaN => QueryBuilder.fcall("blobAsDouble", ByteBufferUtil.EMPTY_BYTE_BUFFER)
case x => x: java.lang.Double // explicit boxing, maybe not necessary
}.asJava
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira