ARRAY_LENGTH function in confluent ksqldb

61 views
Skip to first unread message

Anup Tiwari

unread,
Nov 8, 2020, 8:50:47 AM11/8/20
to ksqldb-users
Hi Team,

I have observed that some of functions mentioned in ksqldb-scalar-functions are not available in confluent ksqldb (confluent 5.5.0). Eg : ARRAY_LENGTH.

May i know how to enable these functions OR there is some version mismatch.

Regards,
Anup Tiwari

Anup Tiwari

unread,
Nov 9, 2020, 2:29:55 AM11/9/20
to James Galasyn, ksqldb-users
Hi Jim,

I tried to ship array_length from here. But i can find this package : import io.confluent.ksql.function.FunctionCategory;
And if i remove this and dependent code then it is giving us an error for different data type like mentioned below :-

Function 'ARRAY_LENGTH' does not accept parameters (ARRAY<INTEGER>).
Function 'ARRAY_LENGTH' does not accept parameters (ARRAY<STRING>).
Function 'ARRAY_LENGTH' does not accept parameters (ARRAY<DOUBLE>).



Let me know if i am missing something.

Regards,
Anup Tiwari


On Mon, Nov 9, 2020 at 1:13 AM James Galasyn <jim.g...@confluent.io> wrote:
Hi Anup,

Thank you for the feedback! The version of ksqlDB that shipped with CP 5.5 is 0.10.2, and that version of the documentation is here: https://docs.ksqldb.io/en/0.10.2-ksqldb/developer-guide/ksqldb-reference/scalar-functions/. If you want to look at different versions, the version selector is in the upper-right corner of the docs site.

Please let me know if you have more questions!
Jim


--
You received this message because you are subscribed to the Google Groups "ksqldb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ksql-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/ksql-users/CAH8KkAoCfHVt6ywoJfELRY7g5gzqroqU1yt1EArbo%2B516w-BJw%40mail.gmail.com.


--

Anup Tiwari

unread,
Nov 9, 2020, 2:39:16 AM11/9/20
to James Galasyn, ksqldb-users
Also @James Galasyn , i went through your link and can see array_length function.



Regards,
Anup Tiwari

Anup Tiwari

unread,
Nov 9, 2020, 8:35:52 PM11/9/20
to James Galasyn, ksqldb-users
Hi Team, 

Can someone check this out? 
We have included functioncategory package but it is still not working. Actual code is present in git link share in trail mail. 

Sergio Pena Anaya

unread,
Nov 10, 2020, 12:03:50 PM11/10/20
to Anup Tiwari, James Galasyn, ksqldb-users
Hey Anup,

I tried ksqlDB 5.5.0, and the ARRAY_LENGTH does not work as you said.

ksql> select array_length(array[1,2,3]) from t1 emit changes;
Can't find any functions with the name 'ARRAY_LENGTH'

I found that the ARRAY_LENGTH was backported to 5.5.1. https://github.com/confluentinc/ksql/pull/5124
Can you try that version?

- Sergio

Reply all
Reply to author
Forward
0 new messages