@Override public IFunctionDescriptor createFunctionDescriptor() { return new ScalarSqlMaxAggregateDescriptor(SqlMaxAggregateDescriptor.FACTORY.createFunctionDescriptor()); } };
public FunctionManager(FunctionCollection functionCollection) { Map<Pair<FunctionIdentifier, Integer>, IFunctionDescriptorFactory> functionsMap = new HashMap<>(); Map<FunctionIdentifier, IFunctionTypeInferer> typeInferersMap = new HashMap<>(); for (IFunctionDescriptorFactory descriptorFactory : functionCollection.getFunctionDescriptorFactories()) { FunctionIdentifier fid = descriptorFactory.createFunctionDescriptor().getIdentifier(); functionsMap.put(new Pair<>(fid, fid.getArity()), descriptorFactory); IFunctionTypeInferer typeInferer = descriptorFactory.createFunctionTypeInferer(); if (typeInferer != null) { typeInferersMap.put(fid, typeInferer); } } this.functions = functionsMap; this.typeInferers = typeInferersMap; }
@Override public IFunctionDescriptor createFunctionDescriptor() { return new ScalarSqlMinAggregateDescriptor(SqlMinAggregateDescriptor.FACTORY.createFunctionDescriptor()); } };
@Override public IFunctionDescriptor createFunctionDescriptor() { return new ScalarSqlStddevPopAggregateDescriptor( SqlStddevPopAggregateDescriptor.FACTORY.createFunctionDescriptor()); } };
@Override public IFunctionDescriptor createFunctionDescriptor() { return new ScalarCountAggregateDescriptor(CountAggregateDescriptor.FACTORY.createFunctionDescriptor()); } };
@Override public IFunctionDescriptor createFunctionDescriptor() { return new ScalarSqlVarPopAggregateDescriptor( SqlVarPopAggregateDescriptor.FACTORY.createFunctionDescriptor()); } };
@Override public IFunctionDescriptor createFunctionDescriptor() { return new ScalarSqlAvgAggregateDescriptor(SqlAvgAggregateDescriptor.FACTORY.createFunctionDescriptor()); } };
@Override public IFunctionDescriptor createFunctionDescriptor() { return new ScalarSqlCountAggregateDescriptor( SqlCountAggregateDescriptor.FACTORY.createFunctionDescriptor()); } };
@Override public IFunctionDescriptor createFunctionDescriptor() { return new ScalarStddevPopAggregateDescriptor( StddevPopAggregateDescriptor.FACTORY.createFunctionDescriptor()); } };
@Override public IFunctionDescriptor createFunctionDescriptor() { return new ScalarVarPopAggregateDescriptor(VarPopAggregateDescriptor.FACTORY.createFunctionDescriptor()); } };
@Override public IFunctionDescriptor createFunctionDescriptor() { return new ScalarVarAggregateDescriptor(VarAggregateDescriptor.FACTORY.createFunctionDescriptor()); } };
@Override public IFunctionDescriptor createFunctionDescriptor() { return new ScalarSqlVarAggregateDescriptor(SqlVarAggregateDescriptor.FACTORY.createFunctionDescriptor()); } };
@Override public IFunctionDescriptor createFunctionDescriptor() { return new ScalarStddevAggregateDescriptor(StddevAggregateDescriptor.FACTORY.createFunctionDescriptor()); } };
@Override public IFunctionDescriptor createFunctionDescriptor() { return new ScalarMinAggregateDescriptor(MinAggregateDescriptor.FACTORY.createFunctionDescriptor()); } };
@Override public IFunctionDescriptor createFunctionDescriptor() { return new ScalarAvgAggregateDescriptor(AvgAggregateDescriptor.FACTORY.createFunctionDescriptor()); } };
@Override public IFunctionDescriptor createFunctionDescriptor() { return new ScalarSqlStddevAggregateDescriptor( SqlStddevAggregateDescriptor.FACTORY.createFunctionDescriptor()); } };
@Override public IFunctionDescriptor createFunctionDescriptor() { return new ScalarMaxAggregateDescriptor(MaxAggregateDescriptor.FACTORY.createFunctionDescriptor()); } };
public IFunctionDescriptor createFunctionDescriptor() { return new ScalarSTUnionAggregateDescriptor(STUnionAggregateDescriptor.FACTORY.createFunctionDescriptor()); } };
@Override public void addGenerated(IFunctionDescriptorFactory descriptorFactory) { add(getGeneratedFunctionDescriptorFactory(descriptorFactory.createFunctionDescriptor().getClass())); }
@Override public IFunctionDescriptor lookupFunction(FunctionIdentifier fid) throws AlgebricksException { Pair<FunctionIdentifier, Integer> key = new Pair<>(fid, fid.getArity()); IFunctionDescriptorFactory factory = functions.get(key); if (factory == null) { throw new AlgebricksException("Inappropriate use of function " + "'" + fid.getName() + "'"); } return factory.createFunctionDescriptor(); }