Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How would I insert a decimal value? #22

Open
noonie2k opened this issue Sep 20, 2014 · 1 comment
Open

How would I insert a decimal value? #22

noonie2k opened this issue Sep 20, 2014 · 1 comment
Assignees

Comments

@noonie2k
Copy link
Contributor

I'm attempting to insert a value into a column with datatype decimal and am trouble getting the correct outcome...

cqlsh:test_keyspace> DESCRIBE TABLE test_decimal ;

CREATE TABLE test_decimal (
  id int,
  value decimal,
  PRIMARY KEY (id)
) WITH
  bloom_filter_fp_chance=0.010000 AND
  caching='KEYS_ONLY' AND
  comment='' AND
  dclocal_read_repair_chance=0.100000 AND
  gc_grace_seconds=864000 AND
  index_interval=128 AND
  read_repair_chance=0.000000 AND
  replicate_on_write='true' AND
  populate_io_cache_on_flush='false' AND
  default_time_to_live=0 AND
  speculative_retry='99.0PERCENTILE' AND
  memtable_flush_period_in_ms=0 AND
  compaction={'class': 'SizeTieredCompactionStrategy'} AND
  compression={'sstable_compression': 'LZ4Compressor'};
// Insert using the php-cassandra-binary package
$database->query('INSERT INTO test_decimal (id, value) VALUES (:id, :value);', ['id' => 1, 'value' => 1.23]);
cqlsh:test_keyspace> INSERT INTO test_decimal (id, value) VALUES (2, 1.23);
cqlsh:test_keyspace> SELECT * FROM test_decimal ;

 id | value
----+-------
  1 |     1
  2 |  1.23

(2 rows)

It appears that the decimal part is always lost when inserting via this package.
(I'm using dev-master at revision 7185308)

Am I doing something wrong or is this a genuine bug?

Thanks for an awesome library that is helping me get away from pdo_cassandra and the Thrift protocol!

Regards,
Adam

@LarsFronius LarsFronius self-assigned this Oct 14, 2014
@LarsFronius
Copy link
Collaborator

I am looking into this right now and it seems to be a bug at the current state. I am working on resolving it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants