User defined Queries are not working in ScyllaDb Enterprise CQL shell and through an error I mentioned in description

CREATE OR REPLACE FUNCTION div(dividend double, divisor double)
  RETURNS NULL ON NULL INPUT
  RETURNS double
  LANGUAGE LUA
  AS 'return dividend/divisor;';

InvalidRequest: Error from server: code=2200 [Invalid query] message="User defined functions are disabled. Set enable_user_defined_functions and experimental_features:udf to enable them"

I tried to change the Scylla.yaml file but enable_user_defined_functions this property was not there .

So I go to official Documentation : Functions | ScyllaDB Docs

What scylla version are you using?
I think that recently this feature moved from “experimental” to “preview” mode (new mode).
Not sure though if it should be enabled by default or not. could be an issue.

Latest scylla enterprise 2023.1 version I am using in UBUNTU 22.04

In this release it’s still experimental.
You should be able to use it in experimental flags. have you tried it?

No I am not able to enable this, I had tried in scylla.yaml file by uncomment “experimental_feature” field and set “udf” to this as you can see in above screenshot, But still not working.

Could you please help me how can I achieve this?

Did you spell udf correctly in the config file?

Yeah I just use the commented part as you can see in screenshot .

I used it like this in config file:

experimental_features: udf

How to mention in config file can you please tell me if I am wrong?

There are two separate options to enable UDF, and both have to be enabled for UDF to work, see below:

experimental_features:
    - udf

enable_user_defined_functions: true

Yeah, I was able to execute this query, but audit logs are not populating.

Query Executed:

CREATE OR REPLACE FUNCTION div(dividend double, divisor double)
  RETURNS NULL ON NULL INPUT
  RETURNS double
  LANGUAGE LUA
  AS 'return dividend/divisor;';

Looks like the CREATE OR REPLACE FUNCTION statement does not trigger an audit event.

Only statement to which we explicitly added audit events will log a corresponding audit event. The statement that are supported w.r.t. audit is driven by customer demand for these (given that this is an enterprise-only feature).

Does that means audit logs for Function will not be generated??

Functions are executed as part of other statements, so we will generate audit logs depending on whether said statement generates audit logs or not.

I did not get your point.

Suppose I run this below command, but it did not generate audit-log.

CREATE OR REPLACE FUNCTION div(dividend double, divisor double)
  RETURNS NULL ON NULL INPUT
  RETURNS double
  LANGUAGE LUA
  AS 'return dividend/divisor;';

Yes, I don’t think we added audit support for this statement, so it will not generate audit log.

But these should be also audited it could be an issue, Only USER DEFINED QUERIES are not generating audit logs.

File an issue in scylla repository and someone will look into fixing it if it gets prioritzed.

Where can I do this in GitHub??

Github Issue was created - https://github.com/scylladb/scylla-enterprise/issues/3863

I am not able to see anything in the mentioned GitHub issue link which you have provided.
It is showing page not found.

If you wish to track progress of this issue, please contact our support for enterprise clients.