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


Java FunctionDesc.setExpression方法代码示例

本文整理汇总了Java中org.apache.kylin.metadata.model.FunctionDesc.setExpression方法的典型用法代码示例。如果您正苦于以下问题:Java FunctionDesc.setExpression方法的具体用法?Java FunctionDesc.setExpression怎么用?Java FunctionDesc.setExpression使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.kylin.metadata.model.FunctionDesc的用法示例。


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

示例1: getMeasureSum

import org.apache.kylin.metadata.model.FunctionDesc; //导入方法依赖的package包/类
public static MeasureDesc getMeasureSum(String column, String dataType) {
    ParameterDesc parameterDesc = new ParameterDesc();
    parameterDesc.setValue(column);
    parameterDesc.setType(FunctionDesc.PARAMETER_TYPE_COLUMN);

    FunctionDesc function = new FunctionDesc();
    function.setExpression(FunctionDesc.FUNC_SUM);
    function.setParameter(parameterDesc);
    function.setReturnType(dataType.equals(HiveTableCreator.HiveTypeEnum.HDOUBLE.toString())
            ? HiveTableCreator.HiveTypeEnum.HDECIMAL.toString()
            : dataType);

    MeasureDesc result = new MeasureDesc();
    result.setName(column + "_SUM");
    result.setFunction(function);
    return result;
}
 
开发者ID:apache,项目名称:kylin,代码行数:18,代码来源:CubeDescCreator.java

示例2: getMeasureCount

import org.apache.kylin.metadata.model.FunctionDesc; //导入方法依赖的package包/类
public static MeasureDesc getMeasureCount() {
    ParameterDesc parameterDesc = new ParameterDesc();
    parameterDesc.setValue("1");
    parameterDesc.setType(FunctionDesc.PARAMETER_TYPE_CONSTANT);

    FunctionDesc function = new FunctionDesc();
    function.setExpression(FunctionDesc.FUNC_COUNT);
    function.setParameter(parameterDesc);
    function.setReturnType(HiveTableCreator.HiveTypeEnum.HBIGINT.toString());

    MeasureDesc result = new MeasureDesc();
    result.setName("_COUNT_");
    result.setFunction(function);
    return result;
}
 
开发者ID:apache,项目名称:kylin,代码行数:16,代码来源:CubeDescCreator.java

示例3: getMeasureMax

import org.apache.kylin.metadata.model.FunctionDesc; //导入方法依赖的package包/类
public static MeasureDesc getMeasureMax(String column, String dataType) {
    ParameterDesc parameterDesc = new ParameterDesc();
    parameterDesc.setValue(column);
    parameterDesc.setType(FunctionDesc.PARAMETER_TYPE_COLUMN);

    FunctionDesc function = new FunctionDesc();
    function.setExpression(FunctionDesc.FUNC_MAX);
    function.setParameter(parameterDesc);
    function.setReturnType(dataType);

    MeasureDesc result = new MeasureDesc();
    result.setName(column + "_MAX");
    result.setFunction(function);
    return result;
}
 
开发者ID:apache,项目名称:kylin,代码行数:16,代码来源:CubeDescCreator.java

示例4: getMeasureMin

import org.apache.kylin.metadata.model.FunctionDesc; //导入方法依赖的package包/类
public static MeasureDesc getMeasureMin(String column, String dataType) {
    ParameterDesc parameterDesc = new ParameterDesc();
    parameterDesc.setValue(column);
    parameterDesc.setType(FunctionDesc.PARAMETER_TYPE_COLUMN);

    FunctionDesc function = new FunctionDesc();
    function.setExpression(FunctionDesc.FUNC_MIN);
    function.setParameter(parameterDesc);
    function.setReturnType(dataType);

    MeasureDesc result = new MeasureDesc();
    result.setName(column + "_MIN");
    result.setFunction(function);
    return result;
}
 
开发者ID:apache,项目名称:kylin,代码行数:16,代码来源:CubeDescCreator.java

示例5: getMeasureHLL

import org.apache.kylin.metadata.model.FunctionDesc; //导入方法依赖的package包/类
public static MeasureDesc getMeasureHLL(String column) {
    ParameterDesc parameterDesc = new ParameterDesc();
    parameterDesc.setValue(column);
    parameterDesc.setType(FunctionDesc.PARAMETER_TYPE_COLUMN);

    FunctionDesc function = new FunctionDesc();
    function.setExpression(FunctionDesc.FUNC_COUNT_DISTINCT);
    function.setParameter(parameterDesc);
    function.setReturnType("hllc12");

    MeasureDesc result = new MeasureDesc();
    result.setName(column + "_HLL");
    result.setFunction(function);
    return result;
}
 
开发者ID:apache,项目名称:kylin,代码行数:16,代码来源:CubeDescCreator.java

示例6: getMeasurePercentile

import org.apache.kylin.metadata.model.FunctionDesc; //导入方法依赖的package包/类
public static MeasureDesc getMeasurePercentile(String column) {
    ParameterDesc parameterDesc = new ParameterDesc();
    parameterDesc.setValue(column);
    parameterDesc.setType(FunctionDesc.PARAMETER_TYPE_COLUMN);

    FunctionDesc function = new FunctionDesc();
    function.setExpression(PercentileMeasureType.FUNC_PERCENTILE);
    function.setParameter(parameterDesc);
    function.setReturnType("percentile(100)");

    MeasureDesc result = new MeasureDesc();
    result.setName(column + "_PERCENTILE");
    result.setFunction(function);
    return result;
}
 
开发者ID:apache,项目名称:kylin,代码行数:16,代码来源:CubeDescCreator.java

示例7: listCubeDrafts

import org.apache.kylin.metadata.model.FunctionDesc; //导入方法依赖的package包/类
public List<Draft> listCubeDrafts(String cubeName, String modelName, String project, boolean exactMatch)
        throws IOException {
    if (null == project) {
        aclEvaluate.checkIsGlobalAdmin();
    } else {
        aclEvaluate.hasProjectReadPermission(getProjectManager().getProject(project));
    }
    List<Draft> result = new ArrayList<>();

    for (Draft d : getDraftManager().list(project)) {
        RootPersistentEntity e = d.getEntity();
        if (e instanceof CubeDesc) {
            CubeDesc c = (CubeDesc) e;
            if ((cubeName == null || (exactMatch && cubeName.toLowerCase().equals(c.getName().toLowerCase()))
                    || (!exactMatch && c.getName().toLowerCase().contains(cubeName.toLowerCase())))
                    && (modelName == null || modelName.toLowerCase().equals(c.getModelName().toLowerCase()))) {
                // backward compability for percentile
                if (c.getMeasures() != null) {
                    for (MeasureDesc m : c.getMeasures()) {
                        FunctionDesc f = m.getFunction();
                        if (f.getExpression().equals(PercentileMeasureType.FUNC_PERCENTILE)) {
                            f.setExpression(PercentileMeasureType.FUNC_PERCENTILE_APPROX);
                        }
                    }
                }
                result.add(d);
            }
        }
    }
    return result;
}
 
开发者ID:apache,项目名称:kylin,代码行数:32,代码来源:CubeService.java


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