UDTF and index based access of array