@Override public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo info) throws SemanticException { return getEvaluator(info.getParameters()); }
@SuppressWarnings("deprecation") @Override public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo info) throws SemanticException { if (info.isAllColumns()) { throw new SemanticException( "The specified syntax for UDAF invocation is invalid."); } return getEvaluator(info.getParameters()); }
@SuppressWarnings("deprecation") @Override public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo info) throws SemanticException { if (info.isAllColumns()) { throw new SemanticException( "The specified syntax for UDAF invocation is invalid."); } return getEvaluator(info.getParameters()); }
((GenericUDAFResolver2) udafResolver).getEvaluator(paramInfo); } else { udafEvaluator = udafResolver.getEvaluator(paramInfo.getParameters());
((GenericUDAFResolver2) udafResolver).getEvaluator(paramInfo); } else { udafEvaluator = udafResolver.getEvaluator(paramInfo.getParameters());
((GenericUDAFResolver2) udafResolver).getEvaluator(paramInfo); } else { udafEvaluator = udafResolver.getEvaluator(paramInfo.getParameters());
((GenericUDAFResolver2) udafResolver).getEvaluator(paramInfo); } else { udafEvaluator = udafResolver.getEvaluator(paramInfo.getParameters());
@Override public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo info) throws SemanticException { TypeInfo[] parameters = info.getParameters(); GenericUDAFSumEvaluator eval = (GenericUDAFSumEvaluator) getEvaluator(parameters); eval.setWindowing(info.isWindowing()); eval.setSumDistinct(info.isDistinct()); return eval; }
@Override public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo paramInfo) throws SemanticException { if (paramInfo.isAllColumns()) { throw new SemanticException( "The specified syntax for UDAF invocation is invalid."); } AbstractGenericUDAFAverageEvaluator eval = (AbstractGenericUDAFAverageEvaluator) getEvaluator(paramInfo.getParameters()); eval.avgDistinct = paramInfo.isDistinct(); eval.isWindowing = paramInfo.isWindowing(); return eval; }
@Override public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo info) throws SemanticException { TypeInfo[] parameters = info.getParameters(); GenericUDAFSumEvaluator eval = (GenericUDAFSumEvaluator) getEvaluator(parameters); eval.setWindowing(info.isWindowing()); eval.setSumDistinct(info.isDistinct()); return eval; }
@Override public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo paramInfo) throws SemanticException { if (paramInfo.isAllColumns()) { throw new SemanticException( "The specified syntax for UDAF invocation is invalid."); } AbstractGenericUDAFAverageEvaluator eval = (AbstractGenericUDAFAverageEvaluator) getEvaluator(paramInfo.getParameters()); eval.avgDistinct = paramInfo.isDistinct(); eval.isWindowing = paramInfo.isWindowing(); return eval; }
@Override public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo paramInfo) throws SemanticException { TypeInfo[] parameters = paramInfo.getParameters(); if (parameters.length == 0) { if (!paramInfo.isAllColumns()) { throw new UDFArgumentException("Argument expected"); } assert !paramInfo.isDistinct() : "DISTINCT not supported with *"; } else { if (parameters.length > 1 && !paramInfo.isDistinct()) { throw new UDFArgumentException("DISTINCT keyword must be specified"); } assert !paramInfo.isAllColumns() : "* not supported in expression list"; } GenericUDAFCountEvaluator countEvaluator = new GenericUDAFCountEvaluator(); countEvaluator.setWindowing(paramInfo.isWindowing()); countEvaluator.setCountAllColumns(paramInfo.isAllColumns()); countEvaluator.setCountDistinct(paramInfo.isDistinct()); return countEvaluator; }
@Override public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo paramInfo) throws SemanticException { TypeInfo[] parameters = paramInfo.getParameters(); if (parameters.length == 0) { if (!paramInfo.isAllColumns()) { throw new UDFArgumentException("Argument expected"); } assert !paramInfo.isDistinct() : "DISTINCT not supported with *"; } else { if (parameters.length > 1 && !paramInfo.isDistinct()) { throw new UDFArgumentException("DISTINCT keyword must be specified"); } assert !paramInfo.isAllColumns() : "* not supported in expression list"; } GenericUDAFCountEvaluator countEvaluator = new GenericUDAFCountEvaluator(); countEvaluator.setWindowing(paramInfo.isWindowing()); countEvaluator.setCountAllColumns(paramInfo.isAllColumns()); countEvaluator.setCountDistinct(paramInfo.isDistinct()); return countEvaluator; }
public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo info) throws SemanticException { TypeInfo[] parameters = info.getParameters();
@SuppressWarnings("deprecation") @Override public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo info) throws SemanticException { if (info.isAllColumns()) { throw new SemanticException( "The specified syntax for UDAF invocation is invalid."); } return getEvaluator(info.getParameters()); }
@SuppressWarnings("deprecation") @Override public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo info) throws SemanticException { if (info.isAllColumns()) { throw new SemanticException( "The specified syntax for UDAF invocation is invalid."); } return getEvaluator(info.getParameters()); } }
@Override public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo paramInfo) throws SemanticException { TypeInfo[] parameters = paramInfo.getParameters(); if (parameters.length == 0) { if (!paramInfo.isAllColumns()) { throw new UDFArgumentException("Argument expected"); } assert !paramInfo.isDistinct() : "DISTINCT not supported with *"; } else { if (parameters.length > 1 && !paramInfo.isDistinct()) { throw new UDFArgumentException("DISTINCT keyword must be specified"); } assert !paramInfo.isAllColumns() : "* not supported in expression list"; } return new GenericUDAFCountEvaluator().setCountAllColumns( paramInfo.isAllColumns()); }
@Override public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo paramInfo) throws SemanticException { TypeInfo[] parameters = paramInfo.getParameters(); if (parameters.length == 0) { if (!paramInfo.isAllColumns()) { throw new UDFArgumentException("Argument expected"); } assert !paramInfo.isDistinct() : "DISTINCT not supported with *"; } else { if (parameters.length > 1 && !paramInfo.isDistinct()) { throw new UDFArgumentException("DISTINCT keyword must be specified"); } assert !paramInfo.isAllColumns() : "* not supported in expression list"; } return new GenericUDAFCountEvaluator().setCountAllColumns( paramInfo.isAllColumns()); }
@Override public GenericUDAFEvaluator getEvaluator(GenericUDAFParameterInfo info) throws SemanticException { @SuppressWarnings("deprecation") TypeInfo[] typeInfo = info.getParameters(); ObjectInspector[] argOIs = info.getParameterObjectInspectors(); if ((typeInfo.length == 1) || (typeInfo.length == 2 && HiveUtils.isConstString(argOIs[1]))) { // sort values by value itself w/o key if (typeInfo[0].getCategory() != ObjectInspector.Category.PRIMITIVE) { throw new UDFArgumentTypeException(0, "Only primitive type arguments are accepted for value but " + typeInfo[0].getTypeName() + " was passed as the first parameter."); } } else if ((typeInfo.length == 2) || (typeInfo.length == 3 && HiveUtils.isConstString(argOIs[2]))) { // sort values by key if (typeInfo[1].getCategory() != ObjectInspector.Category.PRIMITIVE) { throw new UDFArgumentTypeException(1, "Only primitive type arguments are accepted for key but " + typeInfo[1].getTypeName() + " was passed as the second parameter."); } } else { throw new UDFArgumentTypeException(typeInfo.length - 1, "Number of arguments must be in [1, 3] including constant string for options: " + typeInfo.length); } return new UDAFToOrderedListEvaluator(); }
@Override public MergeEvaluator getEvaluator(GenericUDAFParameterInfo info) throws SemanticException { // Get the parameters TypeInfo [] parameters = info.getParameters(); // Check number of arguments if (parameters.length != 1) { throw new UDFArgumentLengthException("Please specify the funnel column."); } // Check if the parameter is not a list if (parameters[0].getCategory() != ObjectInspector.Category.LIST) { throw new UDFArgumentTypeException(0, "Only list type arguments are accepted but " + parameters[0].getTypeName() + " was passed as the first parameter."); } // Check that the list is an array of primitives if (((ListTypeInfo) parameters[0]).getListElementTypeInfo().getCategory() != ObjectInspector.Category.PRIMITIVE) { throw new UDFArgumentTypeException(0, "A long array argument should be passed, but " + parameters[0].getTypeName() + " was passed instead."); } // Check that the list is of type long // May want to add support for int/double/float later switch (((PrimitiveTypeInfo) ((ListTypeInfo) parameters[0]).getListElementTypeInfo()).getPrimitiveCategory()) { case LONG: break; default: throw new UDFArgumentTypeException(0, "A long array argument should be passed, but " + parameters[0].getTypeName() + " was passed instead."); } return new MergeEvaluator(); }