> Your best bet is take the serde you s re using and copy it and change >the code to accept bith null types
Or use a view with an IF(). For instance, I like the ease of generating groovy UDFs inline for quick-n-dirty state machines. We now do column pruning into views, so if you do not select that column it should not run the UDF unecessarily. Most of the times I use a CTE, I really wish there was a "CREATE TEMPORARY VIEW" for me to avoid prefixing all queries. Cheers, Gopal