public static Object getValue(String value, Type type){
        if(value == null){
            return null;
        }

        if(value.startsWith("\"") || value.endsWith("'")){
            value = value.substring(1, value.length() - 1);
        }

        Object objValue;
        if (Type.BOOL.equals(type)){
            objValue = Boolean.valueOf(value);
        } else if(Type.INT8.equals(type)){
            objValue = Byte.valueOf(value);
        } else if(Type.INT16.equals(type)){
            objValue = Short.valueOf(value);
        } else if(Type.INT32.equals(type)){
            objValue = Integer.valueOf(value);
        } else if(Type.INT64.equals(type)){
            objValue = Long.valueOf(value);
        } else if(Type.FLOAT.equals(type)){
            objValue = Float.valueOf(value);
        } else if(Type.DOUBLE.equals(type)){
            objValue = Double.valueOf(value);
        } else if(Type.DECIMAL.equals(type)){
            objValue = new BigDecimal(value);
        } else if(Type.UNIXTIME_MICROS.equals(type)){
            if(NumberUtils.isNumber(value)){
                objValue = Long.valueOf(value);
            } else {
                objValue = Timestamp.valueOf(value);
            }
        } else {
            objValue = value;
        }

        return objValue;
    }
util for kudu use
Date: 2019/12/16
Company: www.dtstack.com
@author maqi
kudu/kudu-side/kudu-side-core/src/main/java/com/dtstack/flink/sql/side/kudu/utils/KuduUtil.java