Xcalar offers an extension called GenRowNum which will generate a row number for a table, starting at 1. The datatype of this generated value is integer.
An easy solution is to apply the mod or whatever filter directly in the table on the row number, prior to calling the UDF, filter out the unwanted rows. Then invoke the UDF only for the remaining rows, so that you not not invoking the UDF unnecessarily, only to discard some of the rows.
Here is another option:
In order to pass this row number and a column to a map UDF, you will to convert the row number's datatype to string and append it to the column value that you originally intended to pass.
Then in the UDF will will need to parse them apart.
One technique it to do the following:
1) run the GenRowNum extension, which will create a new column of integer datatype - for illustration I will call it rownum_int.
2) perform a map concat operation on the rownum_int and use "|" as the 2nd operation, so that you get both a conversion to string datatype and you concatenate a pipe at the end to make parsing easier inside your udf. For illustration lets name that output of that rownum_pipe.
3) now perform a concat of rownum_pipe to whatever the column was you are passing already to the udf.
4) inside your UDF you can split the input string and which will give you your row number info and your value as separate values.