DrillFunctionRegistry.java 文件源码

java
阅读 30 收藏 0 点赞 0 评论 0

项目:QDrill 作者:
public void register(DrillOperatorTable operatorTable) {
  SqlOperator op;
  for (Entry<String, Collection<DrillFuncHolder>> function : methods.asMap().entrySet()) {
    Set<Integer> argCounts = Sets.newHashSet();
    String name = function.getKey().toUpperCase();
    for (DrillFuncHolder func : function.getValue()) {
      if (argCounts.add(func.getParamCount())) {
        if (func.isAggregating()) {
          op = new DrillSqlAggOperator(name, func.getParamCount());
        } else {
          boolean isDeterministic;
          // prevent Drill from folding constant functions with types that cannot be materialized
          // into literals
          if (DrillConstExecutor.NON_REDUCIBLE_TYPES.contains(func.getReturnType().getMinorType())) {
            isDeterministic = false;
          } else {
            isDeterministic = func.isDeterministic();
          }
          op = new DrillSqlOperator(name, func.getParamCount(), func.getReturnType(), isDeterministic);
        }
        operatorTable.add(function.getKey(), op);
      }
    }
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号