Cassandra Maven Plugin - cassandra:load for cql files

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Cassandra Maven Plugin - cassandra:load for cql files

Lorcan Coyle
Hi all,
Are there any plans for a goal for running a CQL-based load scripts, along the lines of the cassandra:load goal for CLI scripts? The Cassandra community is pushing users away from CLI and towards CQL. I think this feature could be a useful addition to the cassandra maven plugin.

The cassandra:cql-exec goal is great for executing statements against a pre-existing keyspace but it cannot (after many hours trying*)  create new keyspaces and populate them in the same way as the cassandra:load goal does with CLI scripts. I've hacked a workable solution, whereby I load CLI using cassandra:load and then follow up with cassandra:cql-exec to execute some `ALTER TABLE` cql statements to rename columns, etc. to make my column families / tables more cql-friendly.

I'll go ahead and add an issue to the jira if there is any take on this suggestion. I'd be happy to help out on this if I can. If there's no traction, I'll stick with my hack...
Lorcan Coyle
Dublin, Ireland

* cassandra:cql-exec executes all statements individually and in isolation, so a 'use <keyspace>;' statement doesn't stick. Also, it doesn't like empty lines or lines with comments (due to the way it splits the input by semi-colon). For running statements in isolation, against a preexisting keyspace it does the job.