I was wondering if anybody could explain the rationale behind disallowing
selection of individual elements from a map in CQL and why an entire map
must be retrieved at once when items are stored as distinct columns? Are
there any plans to allow individual selection?
Liam Stewart ::
Liam Stewart 's gravatar image asked Oct 28 2013 at 19:03 in Cassandra-User by Liam Stewart

2 Answers

There's some rationale here: I'm sure part of the reason is the 64k size limit: maps (and sets
and lists) are limited to 64k total size
(http://wiki.apache.org/cassandra/CassandraLimitations), so it wouldn't
be very read-efficient to load individual elements.
Keith Freeman 's gravatar image answered Oct 29 2013 at 07:24 by Keith Freeman
There is some discussion in this ticket, looks like it was pushed to a later release
https://issues.apache.org/jira/browse/CASSANDRA-3647?focusedCommentId=13292781&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13292781
I cannot find any open tickets for it https://issues.apache.org/jira/browse/CASSANDRA-5918?jql=labels%20%3D%20cql%20AND%20status%20in%20(Open%2C%20%22In%20Progress%22)
May be a good idea to create one and request the feature.
Cheers
Aaron Morton
New Zealand
@aaronmorton
Co-Founder & Principal Consultant
Apache Cassandra Consulting
http://www.thelastpickle.com
Aaron Morton 's gravatar image answered Oct 31 2013 at 01:02 by Aaron Morton

Related Discussions

  • CQL Collections And Solr Dynamic Fields in Cassandra-user

  • In the DSE 4.7 advanced tutorial, there is an example of using a CQL map together with Solr dynamic fields, so that every map entry is automatically indexed by Solr. Does this work for the other CQL collections, namely lists and sets? Can I define CQL lists and sets to use Solr dynamic fields, so they are automatically indexed by Solr?...

  • CQL Select Map Using An IN Relationship in Cassandra-user

  • Hi there, I'm experimenting using cassandra and have run across an error message which I need a little more information on. The use case I'm experimenting with is a series of document updates (documents being an arbitrary map of key value pairs), I would like to find the latest document updates after a specified time period. I don't want to store many copies of the documents (one per update...

  • How To Create A TupleType/TupleValue In A UDF in Cassandra-user

  • Hi All, I have a UDF/UDA that returns a map of date -> TupleValue. CREATE OR REPLACE FUNCTION min_max_by_timestamps_udf(state map, flake blob) RETURNS NULL ON NULL INPUT RETURNS map LANGUAGE java CREATE OR REPLACE AGGREGATE min_max_by_timestamps(blob) SFUNC min_max_by_timestamps_udf STYPE map INITCOND {}; I’ve been using the following syntax to build the TupleType/TupleValue in...

  • Having Counters In A Collection, Like A Map? in Cassandra-user

  • I have a use-case where I need to have a dynamic number of counters. The easiest way to do this would be to have a map where the int is the key, and the counter is the value which is incremented / decremented. E.g if something related to 5 happened, then i'd get the counter for 5 and increment / decrement it. I also need to have multiple maps of this type, where each int is a key referring...

  • Is There A SSTAbleInput For Map/Reduce Instead Of ColumnFamily? in Cassandra-user

  • is there a SSTableInput for Map/Reduce instead of ColumnFamily (which uses thrift)? We are not worried about repeated reads since we are idempotent but would rather have the direct speed (even if we had to read from a snapshot, it would be fine). (We would most likely run our M/R on 4 nodes of the 12 nodes we have since we have RF=3 right now). Thanks, Dean...

  • Fastest Way To Map/parallel Read All Values In A Table? in Cassandra-user

  • What’s the fastest way to map/parallel read all values in a table? Kind of like a mini map only job. I’m doing this to compute stats across our entire corpus. What I did to begin with was use token() and then spit it into the number of splits I needed. So I just took the total key range space which is -2^63 to 2^63 - 1 and broke it into N parts. Then the queries come back as: ...

  • Re:Fastest Way To Map/parallel Read All Values In A Table? in Cassandra-user

  • Just for the record, I was doing the exact same thing in an internal application in the start up I used to work. We have had the need of writing custom code process in parallel all rows of a column family. Normally we would use Spark for the job, but in our case the logic was a little more complicated, so we wrote custom code. What we did was to run N process in M machines (N cores in each), each...

  • How To Map A Set Field? in Cassandra-user

  • Hello all, I have the following table: CREATE TABLE userprincipal ( userid timeuuid, username varchar, hashedpassword blob, authorities set, accountnonexpired boolean, accountnonlocked boolean, credentialsnonexpired boolean, enabled boolean, PRIMARY KEY(username) ); Now, I have an UserPrincipalObject to which Authorities ia a HashSet of UserAuthority Spring objects...

  • Road Map For Cassandra 3.0 in Cassandra-user

  • Hi, Is there a public road map for Cassandra 3.0? Are there any estimates for the release date of 3.0? Regards - Ernesto Reinaldo Barreiro...

  • Insert With If-not-exists Does Not Persist Map in Cassandra-user

  • Cassandra 2.0.2 does not persist the map collection when I specify an if-not-exists clause in the insert operation: cqlsh:mohica>CREATE TABLE simple (id1 TEXT, ,my_map MAP,PRIMARY KEY (id1)); cqlsh:mohica>INSERT INTO simple(id1,my_map) VALUES ('id1',{'a1':'b1','a2':'b1'}) if not exists; [applied] True cqlsh:mohica>SELECT * from simple ; id1 | my_map id1 | null Mohica...

  • Internal Handling Of Map Updates in Cassandra-user

  • Hi, we have a table with a Map Field. We do not delete anything in this table, but to updates on the values including the Map Field (most of the time a new value for an existing key, Rarely adding new keys). We now encounter a huge amount of thumbstones for this Table. We used sstable2json to take a look into the sstables: {"key": "Betty_StoreCatalogLines:7", "cells": [["276-1-6MPQ0RI...

  • Are Updates On Map Columns Causing Tombstones? in Cassandra-user

  • Hi, when I replace the content of a map-valued column (when I replace the complete map), will this create tombstones for those map entries that are not present in the new map? My expectation is 'yes', because the map is laid out as normal columns internally so keys not in the new map should lead to a delete. Is that correct? Jan...

  • Crashed While Running Repair in Cassandra-user

  • Hi, I am experimenting with Cassandra-1.2.4, and got a crash while running repair. The nodes has 24GB of ram with an 8GB heap. Any ideas on my I may have missed in the config ? Log is below ERROR [Thread-136019] 2013-06-22 06:30:05,861 CassandraDaemon.java (line 174) Exception in thread Thread[Thread-136019,5,main] FSReadError in /var/lib/cassandra/data/cut3/Price/cut3-Price-ib-44369-Index...

  • CQL3 And Map Literals in Cassandra-user

  • Hello, I have been playing with map literals in CQL3 queries. I see that single-quotes work: {'foo':'bar'} but double-quotes do not: {"foo":"bar"} I am curious. Was there a specific reason why it was decided to use single-quotes? I ask because double-quotes would make this valid json. thanks in advance, Gareth...

  • Vnodes - HUNDRED Of MapReduce Jobs in Cassandra-user

  • Hi All, I have 3 nodes of Cassandra 1.2.3 & edited the cassandra.yaml for vnodes. When I execute a M/R job .. the console showed HUNDRED of Map tasks. May I know, is the normal since is vnodes? If yes, this have slow the M/R job to finish/complete. Thanks...

  • 0.7 Node Not Starting in Cassandra-user

  • INFO [main] 2013-08-13 18:14:13,674 AbstractCassandraDaemon.java (line 115) Heap size: 8568963072/8568963072 INFO [main] 2013-08-13 18:14:13,674 AbstractCassandraDaemon.java (line 116) Classpath: /usr/share/cassandra/antlr-3.1.3.jar:/usr/share/cassandra/apache-cassandra-0.7.10.jar:/usr/share/cassandra/apache-cassandra.jar:/usr/share/cassandra/avro-1.4.0-fixes.jar:/usr/share/cassandra/avro-1.4...

  • Cassandra Mapreduce Column Is Nul in Cassandra-user

  • Hi all.. I am pretty new to cassandra. I write a mapreduce program that read data from my cassandra columnfamily. My column value is date type but I import it in cassandra as varchar. when I specify my date column (or any other column) as source column to read the dates as map function and assign it to a column of type IColumn and execute the System.out.println(column) in shows me a lot of null...

  • Map Reduce For Cassandra in Cassandra-user

  • Hi, I have the need to executing a map/reduce job to identity data stored in Cassandra before indexing this data to Elastic Search. I have already used ColumnFamilyInputFormat (before start using CQL) to write hadoop jobs to do that, but I use to have a lot of troubles to perform tunning, as hadoop depends on how map tasks are split in order to successfull execute things in parallel, for...

  • Seeing Wierd Exceptions in Cassandra-user

  • Hi, In 2 of our clusters running 2.0.14 version we are seeing following exception, 15-08-05 16:11:32,723 [FlushWriter:268358] ERRORCassandraDaemon Exception in thread Thread[FlushWriter:268358,5,main]FSReadError in/opt/cassandra/data/ks1/cf1/ks1-cf1-jb-231142-Index.db         atorg.apache.cassandra.io.util.MmappedSegmentedFile$Builder.createSegments(MmappedSegmentedFile.java:200)         ...

  • Memory Usage Problem Of Metadata.tokenMap.tokenToHost in Cassandra-user

  • cassandra: 2.1.7 java driver: datastax java driver 2.1.6 Here is the problem: My application uses 2000+ keyspaces, and will dynamically create keyspaces and tables. And then in java client, the Metadata.tokenMap.tokenToHost would use about 1g memory. so this will cause a lot of full gc. As I see, the key of the tokenToHost is keyspace, and the value is a tokenId_to_replicateNodes ...