The parameter type is String(Text) of the HIVE UDFLike.evaluate, which means the UDF initialization will fail if the wrong type passed in. I put an exception throwing here just to guarantee we passed the right type. You are right, it also will throw exception if mis-match case happens, or it maybe never happens if the HiveTypeCoercion always does the right type casting.