Keys are indexed in the order that they appear in the query, starting at 0. In the following query, SUM_AGG would have index 0 and AVG_AGG would have index 1.
SELECT * FROM udaggregation ( on (select * from tab1) using SUM_AGG('A', 'B') AVG_AGG('C') ) as D;
Before calling FNC_TblOpGetCustomKeyInfoAt, you must allocate memory for the out_info data structure:
out_info = FNC_malloc(sizeof(Key_info_t))
You must release the data structure when it is no longer needed:
FNC_free(out_info);