Skip to content

Instantly share code, notes, and snippets.

@lankydan
Created April 15, 2018 17:29
Show Gist options
  • Save lankydan/06ae39cc0a70270f1be7dcdfbc407d7a to your computer and use it in GitHub Desktop.
Save lankydan/06ae39cc0a70270f1be7dcdfbc407d7a to your computer and use it in GitHub Desktop.
Datastax driver - execute CQL from file
String[] statements = split(IOUtils.toString(getClass().getResourceAsStream("/cql/setup.cql")), ";");
Arrays.stream(statements).map(statement -> normalizeSpace(statement) + ";").forEach(session::execute);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment