Code Monkey home page Code Monkey logo

Comments (2)

nickmbailey avatar nickmbailey commented on September 27, 2024

I think the first step would be to allow creating a new column family with an index. Currently we don't have a way to update a column family/keyspace after it is created. Hopefully adding the functionality to the cf creation call will make it easy to add a fn for updating column families that takes advantage of that. At first glance I would imagine this would be an additional possible option passed to the 'make-column-family' function in ddl.clj

The implementation would actually be generalized to allow setting the column_metadata for a column family. That will allow you to create an index as well as just set validators for certain columns. Column metadata is just a list of individual column definitions so something like:

(make-column-family "my_keyspace" 
  {:name "cf1"
   :type :standard
   :column_metadata
     [{:name "c1" :index-name "c1_idx" :index-type :keys :validator :utf8}
      {:name "c2" :validator :integer}])

Above would be an example of both an indexed column as well as just column with a validator. You can see a good example of what the hector code looks like here too: https://github.com/zznate/hector-examples/blob/master/src/main/java/com/riptano/cassandra/hector/example/SchemaManipulation.java#L44

Once that is in place, an update column family function can be added that can retrieve the existing ColumnFamilyDefinition from hector, update the fields passed in by the user, and call the hector method for updating a column family.

from clj-hector.

nickmbailey avatar nickmbailey commented on September 27, 2024

Fixed with pull request 22.

from clj-hector.

Related Issues (16)

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.