当前位置: 首页>>代码示例>>Java>>正文


Java FunctionIdent类代码示例

本文整理汇总了Java中io.crate.metadata.FunctionIdent的典型用法代码示例。如果您正苦于以下问题:Java FunctionIdent类的具体用法?Java FunctionIdent怎么用?Java FunctionIdent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FunctionIdent类属于io.crate.metadata包,在下文中一共展示了FunctionIdent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: register

import io.crate.metadata.FunctionIdent; //导入依赖的package包/类
public static void register(ScalarFunctionModule module) {
    List<DataType> supportedTimestampTypes = ImmutableList.<DataType>of(
            DataTypes.TIMESTAMP, DataTypes.LONG, DataTypes.STRING);
    for (DataType dataType : supportedTimestampTypes) {
        // without format
        module.register(new DateFormatFunction(new FunctionInfo(
                new FunctionIdent(NAME, ImmutableList.of(dataType)),
                DataTypes.STRING)
        ));
        // with format
        module.register(new DateFormatFunction(new FunctionInfo(
                new FunctionIdent(NAME, ImmutableList.of(DataTypes.STRING, dataType)),
                DataTypes.STRING)
        ));
        // time zone aware variant
        module.register(new DateFormatFunction(new FunctionInfo(
                new FunctionIdent(NAME, ImmutableList.of(DataTypes.STRING, DataTypes.STRING, dataType)),
                DataTypes.STRING)
        ));
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:22,代码来源:DateFormatFunction.java

示例2: visitArrayLikePredicate

import io.crate.metadata.FunctionIdent; //导入依赖的package包/类
@Override
public Symbol visitArrayLikePredicate(ArrayLikePredicate node, ExpressionAnalysisContext context) {
    if (node.getEscape() != null) {
        throw new UnsupportedOperationException("ESCAPE is not supported.");
    }
    Symbol rightSymbol = normalize(process(node.getValue(), context));
    Symbol leftSymbol = normalize(process(node.getPattern(), context));
    DataType rightType = rightSymbol.valueType();

    if (!DataTypes.isCollectionType(rightType)) {
        throw new IllegalArgumentException(
                SymbolFormatter.format("invalid array expression: '%s'", rightSymbol));
    }
    rightSymbol = castIfNeededOrFail(rightSymbol, new ArrayType(DataTypes.STRING));
    String operatorName = node.inverse() ? AnyNotLikeOperator.NAME : AnyLikeOperator.NAME;

    FunctionIdent functionIdent = new FunctionIdent(operatorName, Arrays.asList(leftSymbol.valueType(), rightSymbol.valueType()));
    FunctionInfo functionInfo = getFunctionInfo(functionIdent);
    return context.allocateFunction(functionInfo, Arrays.asList(leftSymbol, rightSymbol));
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:21,代码来源:ExpressionAnalyzer.java

示例3: initProxies

import io.crate.metadata.FunctionIdent; //导入依赖的package包/类
private void initProxies(Map<Function, EqProxy> existingProxies) {
    Symbol left = origin.arguments().get(0);
    DataType leftType = origin.info().ident().argumentTypes().get(0);
    DataType rightType = ((CollectionType)origin.info().ident().argumentTypes().get(1)).innerType();
    FunctionInfo eqInfo = new FunctionInfo(
            new FunctionIdent(
                    EqOperator.NAME,
                    ImmutableList.of(leftType, rightType)
            ),
            DataTypes.BOOLEAN
    );
    Literal arrayLiteral = (Literal)origin.arguments().get(1);
    proxies = new HashMap<>();
    for (Literal arrayElem : Literal.explodeCollection(arrayLiteral)) {
        Function f = new Function(eqInfo, Arrays.asList(left, arrayElem));
        EqProxy existingProxy = existingProxies.get(f);
        if (existingProxy == null) {
            existingProxy = new ChildEqProxy(f, this);
        } else if (existingProxy instanceof ChildEqProxy) {
            ((ChildEqProxy) existingProxy).addParent(this);
        }
        proxies.put(f, existingProxy);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:25,代码来源:EqualityExtractor.java

示例4: configure

import io.crate.metadata.FunctionIdent; //导入依赖的package包/类
@Override
protected void configure() {
    functionBinder = MapBinder.newMapBinder(binder(), FunctionIdent.class, FunctionImplementation.class);
    resolverBinder = MapBinder.newMapBinder(binder(), String.class, DynamicFunctionResolver.class);
    IsNullPredicate.register(this);
    NotPredicate.register(this);
    MatchPredicate.register(this);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:9,代码来源:PredicateModule.java

示例5: register

import io.crate.metadata.FunctionIdent; //导入依赖的package包/类
public static void register(AggregationImplModule mod) {
    for (final DataType dataType : DataTypes.PRIMITIVE_TYPES) {
        mod.register(new CollectSetAggregation(new FunctionInfo(new FunctionIdent(NAME,
                ImmutableList.of(dataType)),
                new SetType(dataType), FunctionInfo.Type.AGGREGATE)));
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:CollectSetAggregation.java

示例6: register

import io.crate.metadata.FunctionIdent; //导入依赖的package包/类
public static void register(AggregationImplModule mod) {
    for (final DataType t : DataTypes.PRIMITIVE_TYPES) {
        mod.register(new ArbitraryAggregation(
                new FunctionInfo(new FunctionIdent(NAME, ImmutableList.of(t)), t,
                                FunctionInfo.Type.AGGREGATE)));
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:ArbitraryAggregation.java

示例7: register

import io.crate.metadata.FunctionIdent; //导入依赖的package包/类
public static void register(AggregationImplModule mod) {
    for (DataType t : DataTypes.NUMERIC_PRIMITIVE_TYPES) {
        mod.register(new SumAggregation(new FunctionInfo(new FunctionIdent(NAME, ImmutableList.of(t)),
                        DataTypes.DOUBLE, FunctionInfo.Type.AGGREGATE)));
    }

}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:SumAggregation.java

示例8: register

import io.crate.metadata.FunctionIdent; //导入依赖的package包/类
/**
 * register as "avg" and "mean"
 */
public static void register(AggregationImplModule mod) {
    for (String name :NAMES) {
        for (DataType<?> t : DataTypes.NUMERIC_PRIMITIVE_TYPES) {
            mod.register(new AverageAggregation(new FunctionInfo(
                    new FunctionIdent(name, ImmutableList.<DataType>of(t)), DataTypes.DOUBLE,
                    FunctionInfo.Type.AGGREGATE)));
        }
        mod.register(new AverageAggregation(new FunctionInfo(
                new FunctionIdent(name, ImmutableList.<DataType>of(DataTypes.TIMESTAMP)), DataTypes.DOUBLE,
                FunctionInfo.Type.AGGREGATE)));
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:16,代码来源:AverageAggregation.java

示例9: register

import io.crate.metadata.FunctionIdent; //导入依赖的package包/类
public static void register(AggregationImplModule mod) {
    for (DataType<?> t : DataTypes.NUMERIC_PRIMITIVE_TYPES) {
        mod.register(new VarianceAggregation(new FunctionInfo(
                new FunctionIdent(NAME, ImmutableList.<DataType>of(t)), DataTypes.DOUBLE,
                FunctionInfo.Type.AGGREGATE)));
    }
    mod.register(new VarianceAggregation(new FunctionInfo(
            new FunctionIdent(NAME, ImmutableList.<DataType>of(DataTypes.TIMESTAMP)), DataTypes.DOUBLE,
            FunctionInfo.Type.AGGREGATE)));
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:11,代码来源:VarianceAggregation.java

示例10: register

import io.crate.metadata.FunctionIdent; //导入依赖的package包/类
public static void register(AggregationImplModule mod) {
    for (DataType<?> t : DataTypes.NUMERIC_PRIMITIVE_TYPES) {
        mod.register(new StandardDeviationAggregation(new FunctionInfo(
                new FunctionIdent(NAME, ImmutableList.<DataType>of(t)), DataTypes.DOUBLE,
                FunctionInfo.Type.AGGREGATE)));
    }
    mod.register(new StandardDeviationAggregation(new FunctionInfo(
            new FunctionIdent(NAME, ImmutableList.<DataType>of(DataTypes.TIMESTAMP)), DataTypes.DOUBLE,
            FunctionInfo.Type.AGGREGATE)));
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:11,代码来源:StandardDeviationAggregation.java

示例11: register

import io.crate.metadata.FunctionIdent; //导入依赖的package包/类
public static void register(AggregationImplModule mod) {
    for (final DataType dataType : DataTypes.PRIMITIVE_TYPES) {
        FunctionInfo functionInfo = new FunctionInfo(new FunctionIdent(NAME, ImmutableList.of(dataType)),
                dataType, FunctionInfo.Type.AGGREGATE);

        if (dataType instanceof FixedWidthType) {
            mod.register(new FixedMinimumAggregation(functionInfo));
        } else {
            mod.register(new VariableMinimumAggregation(functionInfo));
        }
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:13,代码来源:MinimumAggregation.java

示例12: getForTypes

import io.crate.metadata.FunctionIdent; //导入依赖的package包/类
@Override
public FunctionImplementation<Function> getForTypes(List<DataType> dataTypes) throws IllegalArgumentException {
    if (dataTypes.size() == 0) {
        return new CountAggregation(COUNT_STAR_FUNCTION, false);
    } else {
        return new CountAggregation(
                new FunctionInfo(new FunctionIdent(NAME, dataTypes),
                        DataTypes.LONG, FunctionInfo.Type.AGGREGATE), true);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:11,代码来源:CountAggregation.java

示例13: register

import io.crate.metadata.FunctionIdent; //导入依赖的package包/类
public static void register(AggregationImplModule mod) {
    for (final DataType dataType : DataTypes.PRIMITIVE_TYPES) {
        FunctionInfo functionInfo = new FunctionInfo(
                new FunctionIdent(NAME, ImmutableList.of(dataType)), dataType, FunctionInfo.Type.AGGREGATE);

        if (dataType instanceof FixedWidthType) {
            mod.register(new FixedMaximumAggregation(functionInfo));
        } else {
            mod.register(new VariableMaximumAggregation(functionInfo));
        }
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:13,代码来源:MaximumAggregation.java

示例14: register

import io.crate.metadata.FunctionIdent; //导入依赖的package包/类
public static void register(AggregationImplModule mod) {
    for (DataType<?> t : DataTypes.NUMERIC_PRIMITIVE_TYPES) {
        mod.register(new GeometricMeanAggregation(new FunctionInfo(
                new FunctionIdent(NAME, ImmutableList.<DataType>of(t)), DataTypes.DOUBLE,
                FunctionInfo.Type.AGGREGATE)));
    }
    mod.register(new GeometricMeanAggregation(new FunctionInfo(
            new FunctionIdent(NAME, ImmutableList.<DataType>of(DataTypes.TIMESTAMP)), DataTypes.DOUBLE,
            FunctionInfo.Type.AGGREGATE)));
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:11,代码来源:GeometricMeanAggregation.java

示例15: register

import io.crate.metadata.FunctionIdent; //导入依赖的package包/类
public static void register(OperatorModule module) {
    for (DataType type : DataTypes.PRIMITIVE_TYPES) {
        FunctionInfo functionInfo = new FunctionInfo(
                new FunctionIdent(NAME, ImmutableList.<DataType>of(type, new SetType(type))), DataTypes.BOOLEAN);
        module.registerOperatorFunction(new InOperator(functionInfo));
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:InOperator.java


注:本文中的io.crate.metadata.FunctionIdent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。