Code Monkey home page Code Monkey logo

Comments (5)

posulliv avatar posulliv commented on June 30, 2024

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.

minaguib avatar minaguib commented on June 30, 2024

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.

minaguib avatar minaguib commented on June 30, 2024

Discussed on IRC / Padraig agrees with the above / Will fix + send pull request.

from libcassandra.

posulliv avatar posulliv commented on June 30, 2024

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.

bmpercy avatar bmpercy commented on June 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.