throw new UDFArgumentTypeException(1, "Double or Float type is expected for the element type of list Vifj: " + typeInfo1.getTypeName()); throw new UDFArgumentTypeException(2, "Double or Float type is expected for the element type of list Vjfi: " + typeInfo1.getTypeName());
@Override public Evaluator getEvaluator(TypeInfo[] typeInfo) throws SemanticException { if (typeInfo.length != 3) { throw new UDFArgumentLengthException( "Expected argument length is 3 but given argument length was " + typeInfo.length); } if (!HiveUtils.isNumberTypeInfo(typeInfo[0])) { throw new UDFArgumentTypeException(0, "Number type is expected for the first argument Wj: " + typeInfo[0].getTypeName()); } if (typeInfo[1].getCategory() != Category.LIST) { throw new UDFArgumentTypeException(1, "List type is expected for the second argument Vjf: " + typeInfo[1].getTypeName()); } ListTypeInfo typeInfo1 = (ListTypeInfo) typeInfo[1]; if (!HiveUtils.isNumberTypeInfo(typeInfo1.getListElementTypeInfo())) { throw new UDFArgumentTypeException(1, "Number type is expected for the element type of list Vjf: " + typeInfo1.getTypeName()); } if (!HiveUtils.isNumberTypeInfo(typeInfo[2])) { throw new UDFArgumentTypeException(2, "Number type is expected for the third argument Xj: " + typeInfo[2].getTypeName()); } return new Evaluator(); }
@Override public Evaluator getEvaluator(TypeInfo[] typeInfo) throws SemanticException { if (typeInfo.length != 3) { throw new UDFArgumentLengthException( "Expected argument length is 3 but given argument length was " + typeInfo.length); } if (!HiveUtils.isNumberTypeInfo(typeInfo[0])) { throw new UDFArgumentTypeException(0, "Number type is expected for the first argument Wj: " + typeInfo[0].getTypeName()); } if (typeInfo[1].getCategory() != Category.LIST) { throw new UDFArgumentTypeException(1, "List type is expected for the second argument Vjf: " + typeInfo[1].getTypeName()); } ListTypeInfo typeInfo1 = (ListTypeInfo) typeInfo[1]; if (!HiveUtils.isNumberTypeInfo(typeInfo1.getListElementTypeInfo())) { throw new UDFArgumentTypeException(1, "Number type is expected for the element type of list Vjf: " + typeInfo1.getTypeName()); } if (!HiveUtils.isNumberTypeInfo(typeInfo[2])) { throw new UDFArgumentTypeException(2, "Number type is expected for the third argument Xj: " + typeInfo[2].getTypeName()); } return new Evaluator(); }