Ksql: Does ksql support user define function?

Created on 29 Aug 2017  路  2Comments  路  Source: confluentinc/ksql

Hi all,

We are using siddhi now, And some of our logic can't write as sql, so we use siddhi's UDF to deal with it.

I had read ksql's document but can't find UDF, so I want know does ksql have plan to support UDF.

question

Most helpful comment

Hi Julian,

Currently we don't have a mechanism to add custom UDFs. We need to decide about security implications of letting users to upload code in runtime. However, you can add your own UDFs by implementing the io.confluent.ksql.function.udf.Kudf interface and adding it to the list of available UDFs in io.confluent.ksql.function.KsqlFunctions. You can find examples in ksql-core under io.confluent.ksql.function package.
Hope this helps.
--Hojjat

All 2 comments

Hi Julian,

Currently we don't have a mechanism to add custom UDFs. We need to decide about security implications of letting users to upload code in runtime. However, you can add your own UDFs by implementing the io.confluent.ksql.function.udf.Kudf interface and adding it to the list of available UDFs in io.confluent.ksql.function.KsqlFunctions. You can find examples in ksql-core under io.confluent.ksql.function package.
Hope this helps.
--Hojjat

I also like this idea... There will probably be many scenarios where this is needed or helpful.

At least a workaround is already available as described by Hojjat.

Was this page helpful?
0 / 5 - 0 ratings