Search code examples
javasqlwildflyteiid

Combine two Java Objects in TEIID


I have a UDF that returns two java objects with double values:

object1 = {1.0,1.5,2.0,2.5}
object2 = {5.0,6.0,7.0,8.0}

I would like to combine/merge them in following way returning a double array:

resultArray = [1.0,5.0,1.5,6.0,2.0,7.0,2.5,8.0]

I have looked in to arrayiterate to return table format and then array_agg to combine the two but I have not been successful with this approach.

Appreciate if I can get some assistance and guidance on what would be the fastest way to get the desired resultArray

Thank you.


Solution

  • Try to use ARRAYTABLE, then you join those two tables.