Error with string function STRING_TO_MV(str1, str2) in 0.22.1 druid version

Hello!
I’d like to execute select STRING_TO_MV(‘sd,sd,ds,ds,ds,sd,ds’, ‘,’) for testing, but it does work with next message:
Error: Unknown exception
[Ljava.lang.String; cannot be cast to java.lang.String
java.lang.ClassCastException

Well, some message exists but I guess it’s not helpful. Below content of /root/apache-druid-0.22.1/var/sv/broker.log :
WARN [sql[54e4ea49-0d2f-49e7-b8a9-c36a1089cf89]] org.apache.druid.sql.http.SqlResource - Failed to handle query: SqlQuery{query=‘SELECT STRING_TO_MV(‘asdad,sd,dsdsds,sdds,dsdssdds’, ‘,’)’, resultFormat=array, header=true, context={sqlOuterLimit=101}, parameters=}
java.lang.ClassCastException: null

Hi Nik -

Short answer, I think this is a bug, and I think a fix is in the works.

Longer answer, I tried this in a recent Imply version and the query worked. Then I tried on 0.22.0 and 0.22.1 and got the same error as you. I did some searching and found this PR, which was merged for 0.23 (and I figure, also merged into Imply versions already). I think that this PR is the issue.

So if you have a query that uses a field instead of a constant expression, it should work, and your query should work when 0.23 comes out.

1 Like

Hi, @Ben_Krug!
0.23 druid version is a next release?