When there are UDFs on the partition column, hive does not push the predicate down to the metastore to get only those partitions. That is why it is scannign all partitions and applying the where clause at runtime.
As a workaround instead of using an UDF in this case, you can try using a shell script to generate the variable name, and use variable substitution feature in hive.
But I agree, it makes sense to push down this predicate in this case as well. The UDFs are deterministic, and can be evaluated before the query is run. Can you please open a jira for this ?