Hi,
MySQL has no ARRAY data type. In array is basicaly a nested table data type and MySQL doesn't support nested tables either, except through dynamic columns. So, a UDF that returned an array could only be used by other UDF that understand arrays. That isn't very useful.
I see two options if you want to push this forward:
a) If you want this to work with MySQL too (the UDF interface is identical) then pass data back as delimited text. For example, I have a UDF called RAPID_EXTRACT_ALL(..) which extracts all values for a key from a JSON document, and returns the values separated by newline. I have stored routines (or other UDF) that understand newline separated input (essentially arrays). I don't think you can do much better for MySQL at the moment.
b) If you want to be compatible with only MariaDB, what you could do is return a BLOB that is properly formatted as a DYNCOL. This way COLUMN_GET, COLUMN_JSON, etc, could work on the blob, and there is a well defined interface for transmitting and accessing the data.
Neither really require development on your part though, except to understand how to pack a DYNCOL blob properly.
--Justin