Platinum Partner
architects,nosql,tips and tricks,cassandra

Dumping/Loading Schema in Cassandra

This handy command line will dump a schema from Cassandra:

echo -e "use your_keyspace;\r\n show schema;\n" | bin/cassandra-cli -h localhost > mySchema.cdl

I always forget the "-e" on echo, which is why I thought I would blog this.  We've started using ".cdl" as the extension, short for "Cassandra DDL".


Coincidentally, you can then load it with:

bin/cassandra-cli -h localhost -f mySchema.cdl

Hope people find this useful.

Published at DZone with permission of {{ articles[0].authors[0].realName }}, DZone MVB. (source)

Opinions expressed by DZone contributors are their own.

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}