case UNION: default: throw new RuntimeException("Unsupported category " + typeInfo.getCategory().name());
case UNION: default: throw new RuntimeException("Unsupported category " + typeInfo.getCategory().name());
throw new RuntimeException("Category " + targetTypeInfo.getCategory().name() + " not supported");
"containing cardinality estimators are allowed as input. Passed a " + cat.name());
@Override public GenericUDAFEvaluator getEvaluator(TypeInfo[] parameters) throws SemanticException { if (parameters.length != 1) { throw new UDFArgumentTypeException(parameters.length - 1, "Exactly one argument is expected."); } ObjectInspector oi = TypeInfoUtils.getStandardJavaObjectInspectorFromTypeInfo(parameters[0]); if (oi.getCategory() != ObjectInspector.Category.PRIMITIVE){ throw new UDFArgumentTypeException(0, "Argument must be PRIMITIVE, but " + oi.getCategory().name() + " was passed."); } PrimitiveObjectInspector inputOI = (PrimitiveObjectInspector) oi; if (inputOI.getPrimitiveCategory() != PrimitiveObjectInspector.PrimitiveCategory.STRING){ throw new UDFArgumentTypeException(0, "Argument must be String, but " + inputOI.getPrimitiveCategory().name() + " was passed."); } return new TotalNumOfLettersEvaluator(); }
/** * Parameters are event date, event count, event uniques, asof date, period array , */ @Override public GenericUDAFEvaluator getEvaluator(TypeInfo[] parameters) throws SemanticException { for (int i = 0; i < parameters.length; ++i) { LOG.info("Type " + i + " == " + parameters[i].getTypeName() + " category " + parameters[i].getCategory().name()); } if (parameters.length != 5 && parameters.length != 6) { throw new UDFArgumentTypeException(parameters.length - 1, "multiday_sketch takes date, count, array, date, array "); } if (parameters[0].getCategory() != Category.PRIMITIVE) { throw new UDFArgumentTypeException(parameters.length - 1, "multiday_sketch takes date, count, array, date, array "); } MultiDayAggUDAFEvaluator mdEval = new MultiDayAggUDAFEvaluator(); return mdEval; }
/** * Parameters are event date, event count, event uniques, asof date, period array , */ @Override public GenericUDAFEvaluator getEvaluator(TypeInfo[] parameters) throws SemanticException { for (int i = 0; i < parameters.length; ++i) { LOG.info("Type " + i + " == " + parameters[i].getTypeName() + " category " + parameters[i].getCategory().name()); } if (parameters.length != 5) { throw new UDFArgumentTypeException(parameters.length - 1, "multiday_count takes date, count, array, date, array "); } if (parameters[0].getCategory() != Category.PRIMITIVE) { throw new UDFArgumentTypeException(parameters.length - 1, "multiday_count takes date, count, array, date, array "); } return new MultiDayAggUDAFEvaluator(); }
throw new RuntimeException("Category " + targetCategory.name() + " not supported");
throw new RuntimeException("Category " + category.name() + " not supported");
throw new RuntimeException("Category " + category.name() + " not supported");
throw new RuntimeException("Category " + targetCategory.name() + " not supported");
throw new RuntimeException("Category " + targetCategory.name() + " not supported");
throw new Error("Unknown category " + typeInfo.getCategory().name());
throw new Error("Unknown category " + typeInfo.getCategory().name());