[SPARK-3485][SQL] should check parameter type when look for constructors

In hiveUdfs, we get constructors of primitivetypes by find a constructor which takes only one parameter. This is very dangerous when more than one constructors match. When the sequence of primitiveTypes becomes larger, the problem would occur, causing a exception as 

java.lang.IllegalArgumentException: argument type mismatch