optimize pig udf, so than HLL is not unnecessarily created and serialized