Code Monkey home page Code Monkey logo

Comments (2)

themanatuf avatar themanatuf commented on July 17, 2024

Ok, I think I found it - libgenthrift/cassandra_types.cpp. I took the warning at the top in the comments to heart, but I couldn't resist :)

ColumnPath::write function at (or near) line 687. For both this->super_column and this->column I added the .c_str() to return the character array rather than writing the string struct. The new function should look as follows:

uint32_t ColumnPath::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  xfer += oprot->writeStructBegin("ColumnPath");
  xfer += oprot->writeFieldBegin("column_family", ::apache::thrift::protocol::T_STRING, 3);
  xfer += oprot->writeString(this->column_family);
  xfer += oprot->writeFieldEnd();
  if (this->__isset.super_column) {
    xfer += oprot->writeFieldBegin("super_column", ::apache::thrift::protocol::T_STRING, 4);
    xfer += oprot->writeBinary(this->super_column.c_str());
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.column) {
    xfer += oprot->writeFieldBegin("column", ::apache::thrift::protocol::T_STRING, 5);
    xfer += oprot->writeBinary(this->column.c_str());
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

I haven't thoroughly tested this, but I AM able to add a column (or super column) with TimeUUID name. I hope this receives everyone well.

from libcassandra.

themanatuf avatar themanatuf commented on July 17, 2024

Ok, disregard my comment/changes earlier. I was not assigning my strings properly in C++ to accomodate TimeUUID's. Here is the proper way (in C++) to assign a TimeUUID to a string and have it get added successfully into Cassandra:

uuid_t uu;
string suu;

uuid_generate_time(uu);
suu.assign((char *)uu, 16);
key_space->insertColumn(row_key, cf, suu, col, val);

Hope that helps someone else in the future. Sorry for any confusion with my earlier posts.

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.