Questions tagged [spring-data-cassandra]

Spring Data for Cassandra is part of Spring Data project which provides a familiar and consistent Spring-based programming model for new datastores while retaining store-specific features and capabilities. The Spring Data Cassandra project provides integration with Cassandra Columnar NoSQL Datastore

spring-data-cassandra
Filter by
Sorted by
Tagged with
0 votes
1 answer
146 views

Filtering CassandraRepository by multiple fields dynamically

I need to filter on multiple fields of an entity dynamically when searching the CassandraRepository. Specifically, there are multiple String fields of the entity. The user can indicate which (if any) ...
uniqueuser-programmer's user avatar
2 votes
2 answers
462 views

Cassandra Prepared Statements broken after schema migration

I'm preparing statements in the constructor of my repository class, like this PreparedStatement getStatement = cqlSession.prepare(selectFrom("the_table") .all() .whereColumn("the_key&...
Andreas Wederbrand's user avatar
0 votes
1 answer
2k views

Spring Boot failing to connect to Testcontainer Cassandra

I am trying to connect to TestContainer Cassandra on my Spring Boot app, but it fails. I've tried many different approaches, but it seems that it cannot connect. Not sure what or where is the problem. ...
Captain Jacky's user avatar
2 votes
0 answers
175 views

Issue while connecting to Cassandra running in docker from Spring boot application

**application.properties: ** spring.data.cassandra.local-datacenter=datacenter1 spring.data.cassandra.keyspace-name=oboe spring.data.cassandra.contact-points=cassandra spring.data....
user20179738's user avatar
1 vote
1 answer
402 views

Why can Spring Data not find suitable converter for UDT?

I defined a UDT POJO class as follows @Getter @Setter @AllArgsConstructor @NoArgsConstructor @UserDefinedType("address_type") public class Address { @Column("address_line") @...
user avatar
1 vote
1 answer
335 views

Can I use spring data repository interface for cassandra async inserts?

@Repository public interface RoundRepository extends CassandraRepository<Round, String> { List<Round> findByInstanceId(String instanceId, Pageable pageable); Round ...
Saievskiy Dmitriy's user avatar
0 votes
2 answers
2k views

Spring Data Cassandra Exception

I am trying to connect my AstraDatabase (Cassandra) with my spring boot application. I had done all the configuration needed when I used to run it. It shows me exception:Error creating bean with name '...
Ahmad Mujtaba's user avatar
1 vote
1 answer
189 views

Should I use ALLOW FILTERING in Cassandra to delete associated entities in a multi-tenant app?

I have a spring-boot project and I am using Cassandra as database. My application is a tenant based application and all my tables include the tenantId. It is always part of the partition key of all ...
yasak's user avatar
  • 13
1 vote
1 answer
206 views

What do I map varchar type to with Cassandra Java driver 4.13.0?

as part of the Cassandra driver migration, I need to migrate a codec registration like bellow. TupleType tupleType = cluster.getMetadata().newTupleType( DataType.timestamp(), DataType.varchar()); ...
Sreekanth P's user avatar
  • 1,197
0 votes
2 answers
570 views

Filtering with comparing each element of a Flux to a single Mono

I am trying to use a Mono of a username to filter out every element of a Flux (the flux having multiple courses) and I am using Cassandra as backend , here is the schema: CREATE TABLE main....
Kantenburg's user avatar
0 votes
2 answers
197 views

Exception about the lack of primary attribute in an entity

I am a newbie with spring boot and Cassandra and I'm trying to connect both to build an API. The project is written in Scala to learn from this too. This is main application: object Application { ...
Alejandro Espada's user avatar
2 votes
3 answers
821 views

Read latency in Cassandra cluster - too many SSTables

We are facing read latency issues on our Cassandra cluster. One of the reason, I read about, is too many SSTables used in read query. As per documents available online, 1-3 SSTables should be queried ...
Anurag Rana's user avatar
  • 1,466
0 votes
1 answer
123 views

Is it possible to return Cassandra Session object in REST API?

I'm looking for possible solutions to connect to multiple Cassandra clusters. I tried some solutions presented, but couldn't make them work. So, I have decided to create a microservice to connect to ...
elkkrover87's user avatar
1 vote
0 answers
154 views

Cassandra how to increase or decrease a count without Counters?

I've heard that Cassandra Counters are considered a bad practice due to performance concerns. Which is a pity as they seem ideal for scenarios where you want to update a count but avoid locks or ...
Shane Gannon's user avatar
  • 7,230
0 votes
1 answer
684 views

Timestamp or date column query issue cassandra 4 (astradb)

I am facing issue with querying cassandra (astradb) from springboot aplication. Here are the details I am using: 'org.springframework.boot' version '2.6.8' implementation 'org.springframework.boot:...
Tuhin Subhra Mandal's user avatar
1 vote
0 answers
44 views

Wiring a custom cassandra cluster config to a repo class during runtime

I have the following classes: @Repository public interface MyRepoDC1 extends CassandraRepository<MyBean, String> { ... } @Repository public interface MyRepoDC2 extends CassandraRepository<...
Soumav's user avatar
  • 385
2 votes
1 answer
554 views

Updating cell value to null in Cassandra and avoid tombstones

We are having DSE 6.8 with Cassandra version 3.11 and ysing spring-data-cassandra 2.2.6 which is using cassandra-driver-core 3.7.2 We have use cases where we need to UPDATE a field (cell) value to ...
Yuval Simhon's user avatar
  • 1,439
1 vote
1 answer
217 views

@SASI.StandardAnalyzed | Tables cannot have more than 0 SASI indexes, failed to create SASI index on table user

I am using the Cassandra database (via Datastax AstraDB) for a search query like SELECT * FROM userdb.users WHERE skill LIKE %jav% AND skill LIKE %node% AND updatedate BETWEEN "1641839170" ...
Prateek Mittal's user avatar
1 vote
0 answers
386 views

Spark cassandra write options

I have an hdfs file that is quite large having 200 million records.I am trying to write this to cassandra using the datastax cassandra writer. This works fine but takes 12 hours,i wanted to write this ...
Swastik Mohanty's user avatar
1 vote
1 answer
663 views

How to save collection of user defined type to ScyllaDB with Spring Data Cassandra?

When I try to save entity with a list or set of user defined type, I get error: Failed to convert from type [java.util.ImmutableCollections$Set12<?>] to type [com.datastax.oss.driver.api.core....
Politechniczny's user avatar
3 votes
0 answers
1k views

spring boot latest CassandraClusterFactoryBean not found error

It seems like as per the latest spring data Cassandra distribution the class CassandraClusterFactoryBean is missing. how do I initialize the cluster? tried to look it up online but no help. can ...
kumaraln's user avatar
2 votes
1 answer
2k views

What is the difference between @PrimaryKeyColumn and @PrimaryKey in Spring Data Cassandra?

I have recently started using Cassandra for my Spring Boot applications. I have always just used @PrimaryKeyColumn and @Id annotation to mark the Primary Key in the Java Class but yesterday I saw a ...
Fclass's user avatar
  • 79
1 vote
0 answers
117 views

Create connection pool in spring-data-cassandra 3.3.3

After updating spring-boot to version 2.6.6, I had to update spring-data-cassandra to version 3.3.3, which doesn't contains PoolingOptions class. How I can set min and max pool size for local and ...
Denis's user avatar
  • 11
0 votes
1 answer
409 views

How to provide CassandraEntityInformation<T, ID> for a SimpleReactiveCassandraRepository?

I'm doing some research bout spring-data-cassandra-reactive and it looks like I can't figure out or find the right documentation about this. According to the documentation you can create an interface ...
tftd's user avatar
  • 16.6k
0 votes
1 answer
403 views

Cassandra Spring-data Multitenancy

So, I'm about to integrate the Multitenancy (one keyspace per tenant) aspect with spring-boot-starter-data-cassandra-reactive, I tried to find a solution to access into the right keyspace and I found ...
ganatrii's user avatar
0 votes
1 answer
1k views

Inject implementation of CassandraRepository in Spring Boot test

I am using Spring Boot and Spring Data Cassandra in my webflux application. I have issue when I do integration test with docker by using testcontainer, Spring doesn't inject the implementation of my ...
Barcelona's user avatar
  • 2,132
1 vote
1 answer
683 views

Multiple Keyspaces in Cassandra Springboot Spring Data while setting credentials for each keyspace

I am trying to configure cassandra for multiple keyspaces , I need to set userName and Password for cassandra, overriding session function which gives me an authentication error, even though I can ...
Akshay Hazari's user avatar
1 vote
1 answer
495 views

Spring Data Cassandra - build fails when dependency is added

I was following this guide https://www.baeldung.com/spring-data-cassandra-tutorial to try and get started with using Cassandra paired with spring boot, however, the Cassandra connector dependency: <...
Charlie Clarke's user avatar
0 votes
1 answer
328 views

Load balancing between Spring Data and Cassandra not working

Cassandra was configured on three physically separated servers and grouped into one cluster. Clustering seems to be working fine. But when I run spring boot I get a warning. 2022-01-20 13:04:13.440 ...
luck Eun's user avatar
0 votes
1 answer
724 views

spring data cassandra : how to tune the return type of an update @Query

Let’s say I have a table like this @Table(value = "myTable") public class MyRow { private UUID id; // primary key private String state; } I have a query that updates a row based ...
cax21's user avatar
  • 11
2 votes
1 answer
2k views

java.lang.NoClassDefFoundError: jnr/posix/POSIXHandler while starting up cassandra based spring-boot app

When I startup my SpringBoot app (where I am using Cassandra as the DB), I get the following trace during startup : Could not register Graph extensions; this is normal if Tinkerpop was explicitly ...
Soumav's user avatar
  • 385
0 votes
0 answers
356 views

Java(open 11) Cassandra Client : connection refused

I have following java code to connect to cassandra: import com.datastax.driver.core.Cluster; import com.datastax.driver.core.Session; public class DBConnect { public static void main(String[] ...
atul ahire's user avatar
0 votes
0 answers
184 views

Cassandra Schema for Reddit Posts,Top posts,new posts

I am new to Cassandra and trying to implement Reddit mock with limited functionalities. I am not considering subreddits and comments as of now. There is a single home page that displays 'Top' posts ...
agarwalsukant's user avatar
1 vote
1 answer
133 views

How do I select all rows from two clustering columns in cassandra database

I have a Partion key: A Clustering columns: B, C I do understand I can query like this Select * from table where A = ? Select * from table where A = ? and B = ? Select * from table where A ...
Hisoka's user avatar
  • 101
0 votes
1 answer
461 views

How to implement Cassandra converter for java time LocalDate to datastax LocalDate?

I have a spring data cassandra query which gets local date values in java.time.LocalDate format and I need to covert this value to com.datastax.driver.core.LocalDate in cassandra configuration bean. ...
stackmj18's user avatar
  • 103
2 votes
2 answers
296 views

How to fetch Primary Key/Clustering column names for a particular table using CQL statements?

I am trying to fetch the Primary Key/Clustering Key names for a particular table/entity and implement the same query in my JPA interface (which extends CassandraRepository). I am not sure whether ...
Soumav's user avatar
  • 385
0 votes
1 answer
871 views

Spring Data Cassandra query by a property of composite primary key

I have my primary key for a table as Composite key comprised of 3 fields: id, username and email. I want to be able to query a user by either just the username or by just the email without knowing ...
Zaid Sheikh's user avatar
1 vote
0 answers
203 views

method in Cassandra Repository with query annotation, returning a different return type from that specified in method definition

I am testing Cassandra as a database using cassandra-spring-data. I have defined a simple table like below @Data @Table @NoArgsConstructor @AllArgsConstructor public class User { @PrimaryKey ...
Njuacha Hubert's user avatar
3 votes
0 answers
428 views

spring-data-cassandra-reactive improve performance of ReactiveCrudRepository.save

I have simple showcase with ReactiveCrudRepository, which shows almost 2x difference in insertion speed using ReactiveCrudRepository.save() vs ReactiveCqlOperations.execute() Here is the code: Entity: ...
Igor Piddubnyi's user avatar
1 vote
0 answers
320 views

Connecting dynamically to Cassandra using Spring Data Cassandra

I need to connect dynamically to new Cassandra clusters without restarting the application. I'm using Spring Data Cassandra. The following code does this, but since it's not done via beans and the IoC,...
Michael Burbidge's user avatar
1 vote
2 answers
318 views

CassandraTemplate fetch last 5 minutes' records based on timeuuid

I have a Cassandra table with a column 'created_at' which stored time based uuids. Now, I need to write a function to fetch all the records in this table that were created in the last 5 minutes. I am ...
T Anna's user avatar
  • 944
2 votes
2 answers
967 views

Spring Cassandra ddl-auto

I'm using Spring with Cassandra and I'm trying to deploy the service to an existing Cassandra DB in production, I've been reading about the ddl-auto and I'm not sure if my code will override the ...
ZKA's user avatar
  • 97
0 votes
1 answer
435 views

Extending AbstractCassandraConfiguration is ignoring application.yml auto configuration

I'm using spring-boot-starter-data-cassandra-reactive(version 3.2.4) and have provided all the spring.data.cassaandra properties is application.yml. It works fine. But I need to add some ...
Raj's user avatar
  • 50
1 vote
1 answer
101 views

Cassandra Read consistency

In my use case for cassandra writes are followed by reads and we are observing stale reads from cassandra. I understand that in cassandra read consistency is tough to achieve but what are alternates, ...
JUser's user avatar
  • 167
0 votes
2 answers
539 views

Spring Boot application should start even if Cassandra is down

I want to make sure that my App gets started even if Cassandra is down. What is the best way to handle that? I am using AbstractReactiveCassandraConfiguration and multiple keyspace implementation. ...
Dhaval's user avatar
  • 15
2 votes
1 answer
146 views

Data Modeling for range queries in Cassandra

I’m designing a new table in Cassandra create table student ( studentid text PRIMARY KEY, department text, major text, updatedon timestamp) I would need to to perform three queries on this table ...
Light Yagami's user avatar
0 votes
1 answer
237 views

cassandra select query to select rows when atleast one column value condition is true

I have a requirement where there are six amount columns. I want to run a select query that gives me rows when either one of the column value is >0 . I tried OR condition but that is not supported. ...
Madhu's user avatar
  • 21
1 vote
3 answers
1k views

Why `spring-data-jpa` with `spring-data-cassandra` won't create cassandra tables automatically?

I'm using spring-data-cassandra:3.1.9 and the properties looks like : spring: data: cassandra: keyspace-name: general_log session-name: general_log local-datacenter: ...
Horsing's user avatar
  • 1,090
1 vote
2 answers
618 views

cassandra query to calculate sum of few columns for each record and print the result as a new column in select query?

I have a requirement where there are six amount columns. I want to run a select query that calculates the sum of the values in six columns for each row (not the SUM() that aggregates the values in a ...
Madhu's user avatar
  • 21
0 votes
1 answer
286 views

How to BULK Read from Azure SQL server and BULK INSERT to Cassandra in Camel

I want to read 5+ million events from an Azure SQL DB table and perform a BULK INSERT to Cassandra. The table has 2 columns. I see the SQL component available for reading from Azure SQL DB. https://...
srikant_mantha's user avatar

1
2
3 4 5
13