Skip to content

Apache Cassandra

Connect to Apache Cassandra so you can browse keyspaces and tables, write CQL, and fill Jasper reports from SELECT result sets.

Connection methods

Standard Cassandra

Native CQL over gocql (hosts / port / optional auth / local datacenter).

DataStax Astra

HTTPS Data API using:

  • API Endpoint — e.g. https://…-us-east-2.apps.astra.datastax.com
  • Token — Astra application token (OS credential store)
  • Keyspace — default default_keyspace

Astra mode does not use gocql, port 9042, or a Secure Connect Bundle. SELECT … FROM keyspace.table in the query editor is mapped to Data API find.

Goal

Create a working Apache Cassandra connection in Connection Manager and use it as a report Data Source.

Prerequisites

Standard Cassandra

  • One or more Cassandra contact points (hosts) reachable from your workstation
  • Port 9042 (default) open
  • Optional username/password if authentication is enabled
  • Local datacenter name (commonly datacenter1)

DataStax Astra

  • Astra database API endpoint (HTTPS)
  • Application token with permissions to read the keyspace
  • Keyspace name (often default_keyspace)

Steps

  1. Open Data → Connection Manager….
  2. Add a connection and choose Apache Cassandra.
  3. Choose Connection Method:
  4. Standard Cassandra — Hosts, Port, Keyspace, Username/Password, Local Datacenter
  5. DataStax Astra — API Endpoint, Token, Keyspace
  6. Click Test to verify connectivity.
  7. Save the connection.
  8. On the Data tab, select the connection. Browse Keyspaces → Tables → Columns.
  9. Add a table or write a SELECT … FROM keyspace.table query.
  10. Apply, preview rows, place fields on the report, then Preview / compile as usual.

[ Screenshot: Cassandra connection settings ]

Notes

Note

Standard Cassandra uses CQL. The visual SQL Query Builder is disabled for Cassandra connections.

Note

Astra uses the Data API over HTTPS. Queries are not executed as CQL and are not sent to gocql.

Note

Report datasets are read-only. Only read/SELECT-shaped table queries are used. INSERT / UPDATE / DELETE / DDL are rejected for standard CQL.

Tip

Passwords and Astra tokens are stored in the operating system credential store, not in JRXML.

Tip

The report CQL is written into the generated JRXML as <query language="cassandra">…</query> (JasperReports 7). Parameters such as $P{p_state} are preserved. Save, Save As, Export, and compile all use the same serializer. Reopening a .jrxml restores the query into the editor.

Tip

Parameters use $P{name}. For multi-value filters prefer $X{IN, column, name} or IN ($P{name}) (standard CQL), or WHERE col = $P{name} / IN ($P{name}) for Astra filters.

Warning

Do not expect relational JOINs, arbitrary GROUP BY, or SQL window functions. For standard Cassandra, do not auto-add ALLOW FILTERING.

Result

The connection appears in Connection Manager. Query results become normal report fields for text fields, groups, charts, crosstabs, variables, preview, and .jasper compilation.

See Also