Hive UDF to DB UDF conversion and partition rewrite