Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable user defined functions in docker instance of cassandra?

Getting the following error when i try to create a simple subtraction function in cassandra:

user defined functions are disabled in cassandra.yaml set enable user defined functions=true

I can't figure out how to set it to true. Where do I go to do this? I am running a docker instance of cassandra which makes it more difficult.

like image 853
J4ce Avatar asked Dec 07 '25 17:12

J4ce


1 Answers

In your docker-compose.yaml file, add the following under your environment:

environment:
    - CASSANDRA_ENABLE_USER_DEFINED_FUNCTIONS=true

Then, modify docker-entrypoint.sh (you can get it from here), and add enable_user_defined_functions

for yaml in \
        broadcast_address \
        broadcast_rpc_address \
        cluster_name \
        endpoint_snitch \
        listen_address \
        num_tokens \
        rpc_address \
        start_rpc \
        enable_user_defined_functions \

Also, You will need to override the docker-entrypoint.sh with the modified version:

volumes:
- ./db/Cassandra/docker-entrypoint.sh:/usr/local/bin/docker-entrypoint.sh
like image 56
Hamzawey Avatar answered Dec 09 '25 11:12

Hamzawey