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


Java IFunction.getArgs方法代码示例

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


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

示例1: buildFunction

import com.taobao.tddl.optimizer.core.expression.IFunction; //导入方法依赖的package包/类
public void buildFunction(IFunction f) {
    if (f.getArgs().size() == 0) {
        return;
    }

    List<Object> args = f.getArgs();
    for (int i = 0; i < args.size(); i++) {
        if (args.get(i) instanceof ISelectable) {
            args.set(i, this.buildSelectable((ISelectable) args.get(i)));

            if (IFunction.FunctionType.Aggregate.equals(f.getFunctionType()) && (args.get(i) instanceof IColumn)) {
                this.columnInAggregate.add((IColumn) args.get(i));
            }
        }
    }
}
 
开发者ID:beebeandwer,项目名称:TDDL,代码行数:17,代码来源:JoinNodeBuilder.java

示例2: buildFunction

import com.taobao.tddl.optimizer.core.expression.IFunction; //导入方法依赖的package包/类
public void buildFunction(IFunction f, boolean findInSelectList) {
    if (FunctionType.Aggregate == f.getFunctionType()) {
        setExistAggregate();
    }

    if (f.getArgs().size() == 0) {
        return;
    }

    List<Object> args = f.getArgs();
    for (int i = 0; i < args.size(); i++) {
        if (args.get(i) instanceof ISelectable) {
            args.set(i, this.buildSelectable((ISelectable) args.get(i), findInSelectList));
        }
    }
}
 
开发者ID:beebeandwer,项目名称:TDDL,代码行数:17,代码来源:QueryTreeNodeBuilder.java

示例3: buildFunction

import com.taobao.tddl.optimizer.core.expression.IFunction; //导入方法依赖的package包/类
protected void buildFunction(IFunction f, boolean findInSelectList) {
    if (FunctionType.Aggregate == f.getFunctionType()) {
        setExistAggregate();
    }

    if (f.getArgs().size() == 0) {
        return;
    }

    List<Object> args = f.getArgs();
    for (int i = 0; i < args.size(); i++) {
        if (args.get(i) instanceof ISelectable) {
            args.set(i, this.buildSelectable((ISelectable) args.get(i), findInSelectList));
        } else if (args.get(i) instanceof ISequenceVal) {
            setExistSequenceVal();
        }
    }
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:19,代码来源:QueryTreeNodeBuilder.java

示例4: buildFunction

import com.taobao.tddl.optimizer.core.expression.IFunction; //导入方法依赖的package包/类
@Override
public void buildFunction(IFunction f, boolean findInSelectList) {
    if (FunctionType.Aggregate == f.getFunctionType()) {
        setExistAggregate();
    }

    for (Object arg : f.getArgs()) {
        if (arg instanceof IFunction) {
            this.buildSelectable((ISelectable) arg, findInSelectList);
        } else if (!this.getNode().isDistinctByShardColumns() && arg instanceof ISelectable) {
            // 针对非distinct的函数,没必要下推字段
            if (((ISelectable) arg).isDistinct()) {
                this.buildSelectable((ISelectable) arg, findInSelectList);
            }
        }
    }
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:18,代码来源:MergeNodeBuilder.java

示例5: isMiddle

import com.taobao.tddl.optimizer.core.expression.IFunction; //导入方法依赖的package包/类
private boolean isMiddle(IFunction func) {
    if (middleFuncName.contains(func.getFunctionName())) {
        if (func.getArgs() != null && func.getArgs().size() == 1) {
            return false;
        }
        return true;
    } else {
        return false;
    }
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:11,代码来源:MysqlPlanVisitorImpl.java

示例6: getColumnNameWithTableName

import com.taobao.tddl.optimizer.core.expression.IFunction; //导入方法依赖的package包/类
public static String getColumnNameWithTableName(Object column) {
    if (column instanceof IColumn) {
        IColumn col = getIColumn(column);
        String colName = getRealTableName(col.getTableName()) + "." + col.getColumnName();
        return colName;
    } else if (column instanceof IFunction) {
        IFunction func = ((IFunction) column);
        StringBuilder sb = new StringBuilder();
        sb.append(func.getFunctionName());
        sb.append("(");
        boolean first = true;
        if (func.isDistinct()) {
            sb.append("DISTINCT ");
        }
        for (Object arg : func.getArgs()) {
            if (first) {
                first = false;
            } else {
                sb.append(",");
            }
            sb.append(getColumnName(arg));
        }
        sb.append(")");
        return sb.toString();
    } else {
        return String.valueOf(column);
    }
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:29,代码来源:ExecUtils.java

示例7: setFunction

import com.taobao.tddl.optimizer.core.expression.IFunction; //导入方法依赖的package包/类
private static void setFunction(IFunction f, String tableName) {
    for (Object arg : f.getArgs()) {
        if (arg instanceof ISelectable) {
            if (arg instanceof IColumn) {
                setColumn((IColumn) arg, tableName);
            } else if (arg instanceof IFilter) {
                setFilter((IFilter) arg, tableName);
            } else if (arg instanceof IFunction) {
                setFunction((IFunction) arg, tableName);
            }
        }

    }
}
 
开发者ID:beebeandwer,项目名称:TDDL,代码行数:15,代码来源:OptimizerUtils.java

示例8: hasArgsAvgFunction

import com.taobao.tddl.optimizer.core.expression.IFunction; //导入方法依赖的package包/类
private boolean hasArgsAvgFunction(IFunction func) {
    for (Object args : func.getArgs()) {
        if (args instanceof IFunction && ((IFunction) args).getColumnName().startsWith("AVG(")) {
            return true;
        }
    }

    return false;
}
 
开发者ID:beebeandwer,项目名称:TDDL,代码行数:10,代码来源:FuckAvgOptimizer.java

示例9: buildFunction

import com.taobao.tddl.optimizer.core.expression.IFunction; //导入方法依赖的package包/类
protected void buildFunction(IFunction f) {
    if (f.getArgs().size() == 0) {
        return;
    }

    List<Object> args = f.getArgs();
    for (int i = 0; i < args.size(); i++) {
        args.set(i, this.buildSelectable((ISelectable) args.get(i)));

    }
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:12,代码来源:BaseShowNode.java

示例10: buildFunction

import com.taobao.tddl.optimizer.core.expression.IFunction; //导入方法依赖的package包/类
public void buildFunction(IFunction f) {
    if (f.getArgs().size() == 0) {
        return;
    }

    List<Object> args = f.getArgs();
    for (int i = 0; i < args.size(); i++) {
        if (args.get(i) instanceof ISelectable) {
            args.set(i, this.buildSelectable((ISelectable) args.get(i)));
        }
    }
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:13,代码来源:JoinNodeBuilder.java

示例11: findAggregateFunctionsInScalar

import com.taobao.tddl.optimizer.core.expression.IFunction; //导入方法依赖的package包/类
private void findAggregateFunctionsInScalar(IFunction s, List<IFunction> res) {
    if (IFunction.FunctionType.Aggregate.equals(s.getFunctionType())) {
        res.add(s);
    }

    for (Object arg : s.getArgs()) {
        if (arg instanceof IFunction) {
            this.findAggregateFunctionsInScalar((IFunction) arg, res);
        }
    }
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:12,代码来源:MergeNodeBuilder.java

示例12: getColumFullName

import com.taobao.tddl.optimizer.core.expression.IFunction; //导入方法依赖的package包/类
public static String getColumFullName(Object column) {
    if (column instanceof IColumn) {
        IColumn col = getIColumn(column);
        String colName = col.getTableName() + "." + col.getColumnName();
        if (col.getAlias() != null) {
            return colName + " as " + col.getAlias();
        } else {
            return colName;
        }

    } else if (column instanceof IFunction && !(column instanceof IFilter)) {
        IFunction func = ((IFunction) column);
        StringBuilder sb = new StringBuilder();
        sb.append(func.getFunctionName());
        sb.append("(");
        boolean first = true;
        if (func.isDistinct()) {
            sb.append("DISTINCT ");
        }
        for (Object arg : func.getArgs()) {
            if (first) {
                first = false;
            } else {
                sb.append(",");
            }
            sb.append(getColumnName(arg));
        }
        sb.append(")");

        if (func.getAlias() != null) {
            sb.append(" as ").append(func.getAlias());
        }
        return sb.toString();
    } else {
        return String.valueOf(column);
    }
}
 
开发者ID:beebeandwer,项目名称:TDDL,代码行数:38,代码来源:ExecUtils.java

示例13: findAggregateFunctionsInScalar

import com.taobao.tddl.optimizer.core.expression.IFunction; //导入方法依赖的package包/类
private void findAggregateFunctionsInScalar(IFunction s, List<IFunction> res) {
    if (IFunction.FunctionType.Aggregate.equals(s.getFunctionType())) {
        res.add(s);
    }

    for (Object arg : s.getArgs()) {
        if (arg instanceof IFunction) {
            this.findAggregateFunctionsInScalar((IFunction) arg, res);
        }
    }

}
 
开发者ID:beebeandwer,项目名称:TDDL,代码行数:13,代码来源:QueryHandlerCommon.java

示例14: getAllAggregates

import com.taobao.tddl.optimizer.core.expression.IFunction; //导入方法依赖的package包/类
public List<IFunction> getAllAggregates(List<IFunction> functions) {
    List<IFunction> aggregates = new LinkedList<IFunction>();

    for (IFunction f : functions) {
        List<IFunction> functionsInArgs = new ArrayList<IFunction>(f.getArgs().size());

        for (Object arg : f.getArgs()) {
            if (arg instanceof IFunction) {
                functionsInArgs.add((IFunction) arg);
            }
        }
        List<IFunction> aggregatesInArgs = this.getAllAggregates(functionsInArgs);
        aggregates.addAll(aggregatesInArgs);

        if (f.getFunctionType().equals(FunctionType.Aggregate)) {
            aggregates.add(f);

            // 聚合函数不能使用聚合函数作为参数
            // 如 max(count(id))是错误的
            if (!aggregatesInArgs.isEmpty()) {
                throw new RuntimeException("Invalid use of group function");
            }
        }
    }

    return aggregates;
}
 
开发者ID:beebeandwer,项目名称:TDDL,代码行数:28,代码来源:AggregateCursor.java

示例15: buildFunction

import com.taobao.tddl.optimizer.core.expression.IFunction; //导入方法依赖的package包/类
public void buildFunction(IFunction f, boolean findInSelectList) {
    for (Object arg : f.getArgs()) {
        if (arg instanceof IFunction) {
            this.buildSelectable((ISelectable) arg, findInSelectList);
        } else if (arg instanceof ISelectable) {
            // 针对非distinct的函数,没必要下推字段
            if (((ISelectable) arg).isDistinct()) {
                this.buildSelectable((ISelectable) arg, findInSelectList);
            }
        }
    }
}
 
开发者ID:beebeandwer,项目名称:TDDL,代码行数:13,代码来源:MergeNodeBuilder.java


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