You may want to try the cassandra-dev mailing list instead.

On 28/03/2022 09:43, Sébastien Rebecchi wrote:
Hi everybody!

Is there someone that could help me on that please?

I even tried to add the jar in $CASSANDRA_HOME/lib/jsr223/java/, but it is not very clear from the official documentation. https://docs.datastax.com/en/cql-oss/3.3/cql/cql_using/useCreateUDF.html

Is there any Cassandra developer having the answer to that issue, how to add jar in classpath so that its classes are taken into account in UDF?

Thanks you!

Sébastien.

Le mer. 23 mars 2022 à 17:30, Sébastien Rebecchi <srebec...@kameleoon.com> a écrit :

    Hello,

    I am trying to create a UDF based on custom methods.
    So I set enable_user_defined_functions to true and added a jar in
    "/usr/share/cassandra/lib/" folder on every node, restarted the
    nodes and I can see from the command line that the jar is indeed
    used (in the classpath with -cp).

    But when i create the UDF I got that error:

    CREATE OR REPLACE FUNCTION blobToJson (input blob) RETURNS NULL ON
    NULL INPUT RETURNS text LANGUAGE java AS 'return
    
com.kameleoon.visit.Visit.writeToJson(com.kameleoon.visit.Visit.readFromByteBuffer(input));';
    InvalidRequest: Error from server: code=2200 [Invalid query]
    message="Java source compilation failed:
    Line 1: com.kameleoon.visit.Visit cannot be resolved to a type
    Line 1: com.kameleoon.visit.Visit cannot be resolved to a type

    Of course the class com.kameleoon.visit.Visit do exist in the jar
    and the jar as read rights to every user (chmod 444). So I can not
    find the reason.

    versions are: [cqlsh 6.0.0 | Cassandra 4.0.1 | CQL spec 3.4.5 |
    Native protocol v5]

    Any help would be appreciated!

    Thanks!

    Sébastien.

Reply via email to