Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

mohmmad.m.aburadeh_143075 avatar image
mohmmad.m.aburadeh_143075 asked Erick Ramirez answered

Is it possible to create a TRIGGER on SELECT operation?

Hi,

I want to create a trigger on the Cassandra table for the SELECT operation.
The idea is when we do SELECT and the data does not exist in the table, we need the trigger to load data from a file into the table, maybe by executing a java code that takes care of the loading from the file into the table. But we need the trigger to be executed on the select operation.
Can you please help ASAP?

Thanks

triggers
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered

No, it is not possible to create a TRIGGER on reads.

Triggers are designed for reacting to and/or augmenting writes. Coordinator nodes execute triggers before applying mutations, not read requests. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.