Skip to content

Replacements for Spring Data for Apache Cassandra#1649

Open
gonzalotguerrero wants to merge 7 commits into
feature/cql-heuristics-calculatorfrom
feature/spring-data-cassandra-replacement
Open

Replacements for Spring Data for Apache Cassandra#1649
gonzalotguerrero wants to merge 7 commits into
feature/cql-heuristics-calculatorfrom
feature/spring-data-cassandra-replacement

Conversation

@gonzalotguerrero

Copy link
Copy Markdown
Collaborator

No description provided.

@jgaleotti

Copy link
Copy Markdown
Collaborator

Hi @gonzalotguerrero , is this ready for review? I do not see that my review was requested yet.

@gonzalotguerrero

Copy link
Copy Markdown
Collaborator Author

Hi @jgaleotti ! It is, sorry! I was waiting for the checks to finish running and then I forgot to request it :p


@Override
protected String getNameOfThirdPartyTargetClass() {
return "org.springframework.data.cassandra.core.CassandraTemplate";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to monitor the schema directly from the cassandra library without having to have hooks in the spring-data library? For MongoDB this was done since the schema was lost from the spring-data library to the MongoDB library.

@gonzalotguerrero gonzalotguerrero Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! I've been doing some more research on the use of Session.getMetadata() we discussed in person.

Extracting the relevant columns directly from every intercepted query in CqlSessionClassReplacement initially sounds OK, but if there's no WHERE clause or if it does not contain all clustering columns, we'd be missing critical metadata, as all columns belonging to the table's primary key must be set during an insertion.

The TableMetadata interface inherits a getPrimaryKey() method from RelationMetadata. There, we could obtain the metadata for all columns that must be set in every insertion. Also these columns cannot be altered, so they could be cached.

Given that, I think with the use of getMetadata() we could cache the primary key of every queried table, and, for every query against a table whose primary key has already been cached, only search for the metadata regarding the non-PK columns present in the WHERE clause, if any.

What do you think of this approach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants