I am working on creating java udf with Cassandra but while developing I have noticed that external jar support is not enabled in 3.11 and whereas the same works with 2.2 version of Cassandra. But not sure if 2.2 version would be supported in future. Does anyone have an idea, what is alternative of using java code from external jar in Cassandra for 3.11 and above?
Asked
Active
Viewed 124 times
0
-
User-defined-functions are disabled by default in the cassandra.yaml for 3.11. I assume you have set enable_user_defined_functions=true to enable it. After copying the jar file to the $CASSANDRA_HOME/lib directory, you will need to restart the cassandra node. – Brad Schoening Jul 21 '21 at 19:19
-
I tried setting enable_user_defined_functions: true in cassandra.yaml and restarted the database after change. But still not able to access the external jar file. Have you tried this with 3.11? Also, I did the same in 2.2 version and it worked. But my concern is 2.2 might not be supported in future. – Varun Sehgal Jul 21 '21 at 19:48
-
Please clarify, what steps have you done? Also how do you think it is not working. At present we can only guess what would have happened. – Manish Khandelwal Jul 22 '21 at 07:03
-
Below mentioned steps i followed :- 1. Updated cassandra.yaml for setting enable_user_defined_functions: true 2. Uploaded external jar in $CASSANDRA_HOME/lib 3. Restarted Cassandra. 4. Now while creating function, that will use Java code - I got the exception that its not able to find the class file. Note - Above commands I ran in Cassandra 3.11. Just to validate the same on other version of Cassandra 2.2 , I ran the same commands and it worked fine and was able to run java code from external jar as well. – Varun Sehgal Jul 22 '21 at 15:45
-
Also i found some article which says the same but just want to validate about the alternatives for 3.11 . https://stackoverflow.com/questions/43661839/how-can-i-create-user-defined-functions-in-cassandra-with-custom-java-class – Varun Sehgal Jul 22 '21 at 15:49