Querying data based on MAPKEYS index and applying filters in UDF

Check out the PredExp class examples for the Java implementation of predicate filtering.

You mean the equivalent of LIMIT in SQL?