Hi there I am writing a hive UDF function. The input could be string, int, double etc. The return is based on the data type. I was trying to use the generic method, however, hive seems not recognize it. Here is the piece of code I have as example.
public <T> T evaluate(final T s, final String column_name, final int bitmap) throws Exception { if (s instanceof Double) return (T) new Double(-1.0); Else if( s instance of Integer) Return (T) new Integer(-1) ; ….. } Does anyone know if hive supports the generic method ? Or I have to override the evaluate method for each type of input. Thanks Dan