# Cassandra Exec CQL

The `Cassandra Exec CQL` action executes one or more Cassandra Quqery Languague (SQL) statements on a Cassandra cluster.

You can use it to create or drop key spaces, tables, indexes and so on.

If all statements executed successfully the result will be true (success).

Check the [Cassandra docs](https://cassandra.apache.org/doc/stable/cassandra/cql/) for more information about CQL.

### Options

| Option                                                                                                                                                                 | Description                                                                                                                                                                              |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Cassandra Connection](https://github.com/mbertazz/hop-docs-md/blob/main/modules/ROOT/pages/workflow/actions/metadata-types/cassandra/cassandra-connection.9mk8tVnytP) | You can specify the name of the connection to use either as a fixed value or as a variable expression. There are buttons to the right of the input field to hel you manage the metadata. |
| CQL Script                                                                                                                                                             | You can enter one or more CQL statements ending with a semi-colon on a new line.                                                                                                         |
| Replace variables in script                                                                                                                                            | Check this option to added variables in your CQL script. These variables will be replaced with the variables values before sending the CQL script to the Cassandra cluster.              |

### Example:

```highlight
CREATE KEYSPACE IF NOT EXISTS hop
WITH replication = {'class':'SimpleStrategy', 'replication_factor' : 3}
;
```

### Result rows

It’s possible to perform one or more queries in this action. The output of the queries will be added to the result rows of the action. You can access these with the plugins like the [Get Rows From Result](/data-shaper-1.21/knowing-the-data-shaper-designer/pipelines/transforms/getrowsfromresult.md) transform or in the [JavaScript](/data-shaper-1.21/knowing-the-data-shaper-designer/workflows/actions/eval.md) action. Please note that result rows are kept in memory so this is intended for small queries, for example getting information from the `system_schema` tables.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.primeur.com/data-shaper-1.21/knowing-the-data-shaper-designer/workflows/actions/cassandra-exec-cql.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
