org.apache.hadoop.hive.ql.exec.Utilities.mergeUniqElems()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(57)

本文整理了Java中org.apache.hadoop.hive.ql.exec.Utilities.mergeUniqElems()方法的一些代码示例,展示了Utilities.mergeUniqElems()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utilities.mergeUniqElems()方法的具体详情如下:
包路径:org.apache.hadoop.hive.ql.exec.Utilities
类名称:Utilities
方法名:mergeUniqElems

Utilities.mergeUniqElems介绍

暂无

代码示例

代码示例来源:origin: apache/hive

@Override
public List<String> getReferencedColumns() throws SemanticException {
 MatchPath matchPath = (MatchPath) evaluator;
 List<String> columns = new ArrayList<>();
 for (ExprNodeDesc exprNode : matchPath.resultExprInfo.resultExprNodes) {
  Utilities.mergeUniqElems(columns, exprNode.getCols());
 }
 for (ExprNodeDesc exprNode : matchPath.symInfo.symbolExprsDecs) {
  Utilities.mergeUniqElems(columns, exprNode.getCols());
 }
 return columns;
}

代码示例来源:origin: apache/hive

@Override
public List<String> getCols() {
 List<String> colList = new ArrayList<String>();
 if (desc != null) {
  colList = Utilities.mergeUniqElems(colList, desc.getCols());
 }
 return colList;
}

代码示例来源:origin: apache/drill

@Override
public List<String> getCols() {
 List<String> colList = new ArrayList<String>();
 if (desc != null) {
  colList = Utilities.mergeUniqElems(colList, desc.getCols());
 }
 return colList;
}

代码示例来源:origin: apache/hive

@Override
public List<String> getCols() {
 List<String> colList = new ArrayList<String>();
 if (chidren != null) {
  int pos = 0;
  while (pos < chidren.size()) {
   List<String> colCh = chidren.get(pos).getCols();
   colList = Utilities.mergeUniqElems(colList, colCh);
   pos++;
  }
 }
 return colList;
}

代码示例来源:origin: apache/drill

@Override
public List<String> getReferencedColumns() throws SemanticException {
 MatchPath matchPath = (MatchPath) evaluator;
 List<String> columns = new ArrayList<>();
 for (ExprNodeDesc exprNode : matchPath.resultExprInfo.resultExprNodes) {
  Utilities.mergeUniqElems(columns, exprNode.getCols());
 }
 for (ExprNodeDesc exprNode : matchPath.symInfo.symbolExprsDecs) {
  Utilities.mergeUniqElems(columns, exprNode.getCols());
 }
 return columns;
}

代码示例来源:origin: apache/drill

@Override
public List<String> getCols() {
 List<String> colList = new ArrayList<String>();
 if (chidren != null) {
  int pos = 0;
  while (pos < chidren.size()) {
   List<String> colCh = chidren.get(pos).getCols();
   colList = Utilities.mergeUniqElems(colList, colCh);
   pos++;
  }
 }
 return colList;
}

代码示例来源:origin: apache/hive

public List<String> genColLists(
  HashMap<Operator<? extends OperatorDesc>, OpParseContext> opParseCtx) {
 List<String> colLists = new ArrayList<String>();
 ArrayList<ExprNodeDesc> keys = conf.getKeys();
 for (ExprNodeDesc key : keys) {
  colLists = Utilities.mergeUniqElems(colLists, key.getCols());
 }
 ArrayList<AggregationDesc> aggrs = conf.getAggregators();
 for (AggregationDesc aggr : aggrs) {
  ArrayList<ExprNodeDesc> params = aggr.getParameters();
  for (ExprNodeDesc param : params) {
   colLists = Utilities.mergeUniqElems(colLists, param.getCols());
  }
 }
 return colLists;
}

代码示例来源:origin: apache/drill

public List<String> genColLists(
  HashMap<Operator<? extends OperatorDesc>, OpParseContext> opParseCtx) {
 List<String> colLists = new ArrayList<String>();
 ArrayList<ExprNodeDesc> keys = conf.getKeys();
 for (ExprNodeDesc key : keys) {
  colLists = Utilities.mergeUniqElems(colLists, key.getCols());
 }
 ArrayList<AggregationDesc> aggrs = conf.getAggregators();
 for (AggregationDesc aggr : aggrs) {
  ArrayList<ExprNodeDesc> params = aggr.getParameters();
  for (ExprNodeDesc param : params) {
   colLists = Utilities.mergeUniqElems(colLists, param.getCols());
  }
 }
 return colLists;
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

@Override
public List<String> getReferencedColumns() throws SemanticException {
 MatchPath matchPath = (MatchPath) evaluator;
 List<String> columns = new ArrayList<>();
 for (ExprNodeDesc exprNode : matchPath.resultExprInfo.resultExprNodes) {
  Utilities.mergeUniqElems(columns, exprNode.getCols());
 }
 for (ExprNodeDesc exprNode : matchPath.symInfo.symbolExprsDecs) {
  Utilities.mergeUniqElems(columns, exprNode.getCols());
 }
 return columns;
}

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

@Override
public List<String> getCols() {
 List<String> colList = new ArrayList<String>();
 if (desc != null) {
  colList = Utilities.mergeUniqElems(colList, desc.getCols());
 }
 return colList;
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

@Override
public List<String> getCols() {
 List<String> colList = new ArrayList<String>();
 if (desc != null) {
  colList = Utilities.mergeUniqElems(colList, desc.getCols());
 }
 return colList;
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

@Override
public List<String> getCols() {
 List<String> colList = new ArrayList<String>();
 if (chidren != null) {
  int pos = 0;
  while (pos < chidren.size()) {
   List<String> colCh = chidren.get(pos).getCols();
   colList = Utilities.mergeUniqElems(colList, colCh);
   pos++;
  }
 }
 return colList;
}

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

@Override
public List<String> getCols() {
 List<String> colList = new ArrayList<String>();
 if (childExprs != null) {
  int pos = 0;
  while (pos < childExprs.size()) {
   List<String> colCh = childExprs.get(pos).getCols();
   colList = Utilities.mergeUniqElems(colList, colCh);
   pos++;
  }
 }
 return colList;
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

public List<String> genColLists(
  HashMap<Operator<? extends OperatorDesc>, OpParseContext> opParseCtx) {
 List<String> colLists = new ArrayList<String>();
 ArrayList<ExprNodeDesc> keys = conf.getKeys();
 for (ExprNodeDesc key : keys) {
  colLists = Utilities.mergeUniqElems(colLists, key.getCols());
 }
 ArrayList<AggregationDesc> aggrs = conf.getAggregators();
 for (AggregationDesc aggr : aggrs) {
  ArrayList<ExprNodeDesc> params = aggr.getParameters();
  for (ExprNodeDesc param : params) {
   colLists = Utilities.mergeUniqElems(colLists, param.getCols());
  }
 }
 return colLists;
}

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

public List<String> genColLists(
  HashMap<Operator<? extends Serializable>, OpParseContext> opParseCtx) {
 List<String> colLists = new ArrayList<String>();
 ArrayList<ExprNodeDesc> keys = conf.getKeys();
 for (ExprNodeDesc key : keys) {
  colLists = Utilities.mergeUniqElems(colLists, key.getCols());
 }
 ArrayList<AggregationDesc> aggrs = conf.getAggregators();
 for (AggregationDesc aggr : aggrs) {
  ArrayList<ExprNodeDesc> params = aggr.getParameters();
  for (ExprNodeDesc param : params) {
   colLists = Utilities.mergeUniqElems(colLists, param.getCols());
  }
 }
 return colLists;
}

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

/**
 * Creates the list of internal column names from select expressions in a
 * select operator. This function is used for the select operator instead of
 * the genColLists function (which is used by the rest of the operators).
 * 
 * @param op
 *          The select operator.
 * @return List<String> of the internal column names.
 */
public List<String> getColsFromSelectExpr(SelectOperator op) {
 List<String> cols = new ArrayList<String>();
 SelectDesc conf = op.getConf();
 ArrayList<ExprNodeDesc> exprList = conf.getColList();
 for (ExprNodeDesc expr : exprList) {
  cols = Utilities.mergeUniqElems(cols, expr.getCols());
 }
 return cols;
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

if (colList == null || colList.contains(outputColumnNames.get(i))) {
 ExprNodeDesc expr = selectExprs.get(i);
 cols = Utilities.mergeUniqElems(cols, expr.getCols());

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx ctx,
   Object... nodeOutputs) throws SemanticException {
  GroupByOperator op = (GroupByOperator) nd;
  ColumnPrunerProcCtx cppCtx = (ColumnPrunerProcCtx) ctx;
  List<String> colLists = new ArrayList<String>();
  GroupByDesc conf = op.getConf();
  ArrayList<ExprNodeDesc> keys = conf.getKeys();
  for (ExprNodeDesc key : keys) {
   colLists = Utilities.mergeUniqElems(colLists, key.getCols());
  }
  ArrayList<AggregationDesc> aggrs = conf.getAggregators();
  for (AggregationDesc aggr : aggrs) {
   ArrayList<ExprNodeDesc> params = aggr.getParameters();
   for (ExprNodeDesc param : params) {
    colLists = Utilities.mergeUniqElems(colLists, param.getCols());
   }
  }
  cppCtx.getPrunedColLists().put(op, colLists);
  return null;
 }
}

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx ctx,
   Object... nodeOutputs) throws SemanticException {
  FilterOperator op = (FilterOperator) nd;
  ColumnPrunerProcCtx cppCtx = (ColumnPrunerProcCtx) ctx;
  ExprNodeDesc condn = op.getConf().getPredicate();
  // get list of columns used in the filter
  List<String> cl = condn.getCols();
  // merge it with the downstream col list
  cppCtx.getPrunedColLists().put(op,
    Utilities.mergeUniqElems(cppCtx.genColLists(op), cl));
  pruneOperator(cppCtx, op, cppCtx.getPrunedColLists().get(op));
  return null;
 }
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

@Override
 public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx ctx,
   Object... nodeOutputs) throws SemanticException {
  FilterOperator op = (FilterOperator) nd;
  ColumnPrunerProcCtx cppCtx = (ColumnPrunerProcCtx) ctx;
  ExprNodeDesc condn = op.getConf().getPredicate();
  // get list of columns used in the filter
  List<String> cl = condn.getCols();
  // merge it with the downstream col list
  List<String> filterOpPrunedColLists = Utilities.mergeUniqElems(cppCtx.genColLists(op), cl);
  List<String> filterOpPrunedColListsOrderPreserved = preserveColumnOrder(op,
    filterOpPrunedColLists);
  cppCtx.getPrunedColLists().put(op,
    filterOpPrunedColListsOrderPreserved);
  pruneOperator(cppCtx, op, cppCtx.getPrunedColLists().get(op));
  cppCtx.handleFilterUnionChildren(op);
  return null;
 }
}

相关文章

微信公众号

最新文章

更多

Utilities类方法