I have to create Multiple Column Families in my keyspace. One way is to
create the column families one by one.. But in my case, I have around 100
column families so I cannot do it one by one... So is there any way, I can
create multiple column families through some sort of script which can
create multiple column families for me in one short?

    create column family USER_DATA_SECOND_1
    with comparator = 'UTF8Type'
    and key_validation_class = 'CompositeType(DateType,UTF8Type)'
    and default_validation_class = 'BytesType'
    and gc_grace = 86400

    create column family USER_DATA_SECOND_2
    with comparator = 'UTF8Type'
    and key_validation_class = 'CompositeType(DateType,UTF8Type)'
    and default_validation_class = 'BytesType'
    and gc_grace = 86400

    create column family USER_DATA_SECOND_3
    with comparator = 'UTF8Type'
    and key_validation_class = 'CompositeType(DateType,UTF8Type)'
    and default_validation_class = 'BytesType'
    and gc_grace = 86400

    ....
    ....
    ....

    create column family USER_DATA_SECOND_100
    with comparator = 'UTF8Type'
    and key_validation_class = 'CompositeType(DateType,UTF8Type)'
    and default_validation_class = 'BytesType'
    and gc_grace = 86400
And also after creating these multiple column families.. Suppose if I need
to drop all these column families again then how to do that using some
script again?

Below is the way, I am creating the column families now from my local
machine to my staging cassandra server one by one, which is not what I
want..

    C:\Apache Cassandra\apache-cassandra-1.2.3\bin>cassandra-cli -h
sc-cdbhost01.vip.slc.qa.host.com
    Starting Cassandra Client
    Connected to: "Staging Cluster cass01" on
sc-cdbhost01.vip.slc.qa.host.com/9160
    Welcome to Cassandra CLI version 1.2.3

    Type 'help;' or '?' for help.
    Type 'quit;' or 'exit;' to quit.

    [default@unknown] use profileks;
    Authenticated to keyspace: profileks
    [default@profileks] create column family USER_DATA_SECOND_1
    ...     with comparator = 'UTF8Type'
    ...     and key_validation_class = 'CompositeType(DateType,UTF8Type)'
    ...     and default_validation_class = 'BytesType'
    ...     and gc_grace = 86400;
    27fe1848-c7de-3994-9289-486a9bbbf344
    [default@profileks]

Can anyone help me whether this is possible to create multiple column
families through some sort of script and then drop those column families as
well through some sort of script?

Reply via email to