User-defined functions

So far, we have only done simple SELECT operations that are inherently permitted by Cassandra. In the case of complex queries, where we could not fetch results based on just the primary key indexes, we built secondary indexes and materialized views. What if there arises a situation where you are required to perform some custom computations? Fortunately, Cassandra provides custom user-defined functions to perform some simple computations on the data present in Cassandra.

UDFs allow the execution of user code on the server side. The coordinator node takes care of the computation. In Cassandra 3.0 and later, UDFs are executed in a sandbox. You can also use custom security managers to prevent UDFs from accessing the filesystem ...

Get Learning Apache Cassandra - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.