Hi,
I am not able to find what is best way to query the output of a scalar
table function.
Suppose I have table which has column col1 which is string.
I have a scalar function and returns a POJO
{col1V1 String, col1V2 String , col1V3 String}.
I am using following.
so table.select("sf(col1) as sfc")
.select("sfc.get('col1V1') as v1, sfc.get('col1V2') as v2 ,
sfc.get('col1V13') as v3 ")
It is working fine but strangely enough it calls the sf 3 times(each per
get) for same row. However, If I use table function it calls just once.
So to me it seems that scalar function is very expensive so if I have 10
columns and the computation is expensive it will do 10 times. Thats why I
thought maybe there is a better way to return pojo from scalar function
rather than what I have been using.
If this is the best way then I wonder if scalar functions should be used to
return single value only.
Thanks