[ Eric Evans ] Thanks for the help, fully qualifying my tables works a treat and your exec-cql3.patch patch solves the "empty lines" problem when executing CQL from a file.
I spent a few hours today working on a load CQL patch that built on your 2_0_0.patch patch. I hope it makes sense? On 23 September 2013 21:26, Eric Evans <eev...@sym-link.com> wrote: > [ Lorcan Coyle ] > > 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. > > TTBMK, it runs semilcolon deimited statements as-is, which should be all > you need; I've used it to create keyspaces and column families. > > > 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... > > On a somewhat unrelated note, I banged together a patch that updates > support to CQL 3. It's attached to this email, but if I can figure out > how to submit a Jira issue, I'll attach it there as well. > > > * 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. > > Yeah, you should fully qualify your tables, i.e.: > > CREATE TABLE <keyspace>.<table> (id int PRIMARY KEY); > > -- > Eric Evans > eev...@sym-link.com > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > >