Comments (5)
First off, I'm really really sorry for the delayed response. I had my master's thesis defense this morning so have been unable to any interesting work in the last few weeks ;)
To answer your question, the column_name parameter actually is the super_column_name. The insert functions such as insertColumn and insertSuperColumn are just wrappers around the thrift API. In the thrift API documented on the Cassandra wiki:
http://wiki.apache.org/cassandra/API
You will see the insert function takes a ColumnPath parameter. In a perfect world, we would not need a separate method for inserting a super column or inserting a regular column. The reason for this is the horrible thrift API that we are wrapping. If you look at the source for both insert functions in the keyspace.cc file you will that there is only 1 line that is different.
I'm not sure if that answers your question fully or not but feel free to ask more and I'll make sure to answer them in a more timely manner this time :)
from libcassandra.
Hi Padraig
Something is confusing me about this same issue as well.
If you compare the cassandra-cli set command for a regular column:
cassandra> set Keyspace1.Standard2['joe']['age'] = '20'
It equivalent to this libcassandra call:
insertColumn("joe", "Standard2", "age", "20")
However, consider the cassandra-cli command which sets in a supercolumn:
cassandra> set Keyspace1.Super2['joe']['friends']['bob'] = 'Happy'
I'm confused as to how this would be when using libcassandra's insertSuperColumn
Inspecting the code, I think the method is missing a super_column_name in its signature, and then something like col_path.super_column.assign(super_column_name)
Or perhaps I'm missing something (perhaps column_name is combined with a delimiter ?)...
from libcassandra.
Discussed on IRC / Padraig agrees with the above / Will fix + send pull request.
from libcassandra.
Do you mind me asking what you would like to see? To be honest, I don't work with super-columns so its hard for me to comment on the super column API. Hopefully, minaguib can add some insight on your issue.
One thing I'm thinking of doing is adding an insert method that exposes the lower level ColumnPath object so that the insert API would be:
insert(const std::string &key,
const org::apache::cassandra::ColumnPath &column_path,
const std::string &value);
This is how the Java client Hector handles insert.
Doing it this way would remove the confusion and make the API much simpler to maintain but might make it a bit harder on the user.
from libcassandra.
minaguib's API change makes sense to me. that's the kind of change i was thinking you'd need....just wasn't sure how you were expecting the supercolumn and column names to be squished into a single string argument in the old form. :) thanks, you two!
from libcassandra.
Related Issues (19)
- make warnings => errors regarding variadic macros... HOT 5
- Creating ColumnFamily and Column through C++ code HOT 2
- Creating Column and their datatype dynamically in libcassandra HOT 1
- Compilation Issue on Mac OSX HOT 1
- using getcount() showing "predicate column_names and slice_range may not both be null" HOT 1
- Assigning columnNames to SlicePredicate
- ColumnType as Integer doesn't accept Integer data
- TException : No more data to read. HOT 2
- Build errors with gcc 4.5.2 and thrift 0.6.0 HOT 4
- configure warns of problems with assert.h
- Compilation errors.
- Catch TTransportException and rethrow an UnavailableExpception HOT 2
- Bug in removing super column HOT 3
- Memory leaks in cassandra.cc
- Unable to use TimeUUID as Column Name HOT 2
- Build broken? HOT 7
- Unable to remove an entire row specified by a key HOT 1
- Using factory->create() on an endpoint that is down, causes a memroy leak HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libcassandra.