org.apache.hadoop.hive.ql.parse.QBParseInfo.getDestCubes()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(56)

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

QBParseInfo.getDestCubes介绍

暂无

代码示例

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

ObjectPair<List<ASTNode>, List<Long>> getGroupByGroupingSetsForClause(
 QBParseInfo parseInfo, String dest) throws SemanticException {
 List<Long> groupingSets = new ArrayList<Long>();
 List<ASTNode> groupByExprs = getGroupByForClause(parseInfo, dest);
 if (parseInfo.getDestRollups().contains(dest)) {
  groupingSets = getGroupingSetsForRollup(groupByExprs.size());
 } else if (parseInfo.getDestCubes().contains(dest)) {
  groupingSets = getGroupingSetsForCube(groupByExprs.size());
 } else if (parseInfo.getDestGroupingSets().contains(dest)) {
  groupingSets = getGroupingSets(groupByExprs, parseInfo, dest);
 }
 if (!groupingSets.isEmpty() && groupByExprs.size() > Long.SIZE) {
  throw new SemanticException(ErrorMsg.HIVE_GROUPING_SETS_SIZE_LIMIT.getMsg());
 }
 return new ObjectPair<List<ASTNode>, List<Long>>(groupByExprs, groupingSets);
}

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

private ObjectPair<List<ASTNode>, List<Integer>> getGroupByGroupingSetsForClause(
  QBParseInfo parseInfo, String dest) throws SemanticException {
 List<Integer> groupingSets = new ArrayList<Integer>();
 List<ASTNode> groupByExprs = getGroupByForClause(parseInfo, dest);
 if (parseInfo.getDestRollups().contains(dest)) {
  groupingSets = getGroupingSetsForRollup(groupByExprs.size());
 } else if (parseInfo.getDestCubes().contains(dest)) {
  groupingSets = getGroupingSetsForCube(groupByExprs.size());
 } else if (parseInfo.getDestGroupingSets().contains(dest)) {
  groupingSets = getGroupingSets(groupByExprs, parseInfo, dest);
 }
 return new ObjectPair<List<ASTNode>, List<Integer>>(groupByExprs, groupingSets);
}

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

private RelNode genGBHavingLogicalPlan(QB qb, RelNode srcRel, Map<String, RelNode> aliasToRel)
  throws SemanticException {
 RelNode gbFilter = null;
 QBParseInfo qbp = getQBParseInfo(qb);
 String destClauseName = qbp.getClauseNames().iterator().next();
 ASTNode havingClause = qbp.getHavingForClause(qbp.getClauseNames().iterator().next());
 if (havingClause != null) {
  if (!(srcRel instanceof HiveAggregate)) {
   // ill-formed query like select * from t1 having c1 > 0;
   throw new CalciteSemanticException("Having clause without any group-by.",
     UnsupportedFeature.Having_clause_without_any_groupby);
  }
  ASTNode targetNode = (ASTNode) havingClause.getChild(0);
  validateNoHavingReferenceToAlias(qb, targetNode);
  if (!qbp.getDestToGroupBy().isEmpty()) {
   final boolean cubeRollupGrpSetPresent = (!qbp.getDestRollups().isEmpty()
       || !qbp.getDestGroupingSets().isEmpty() || !qbp.getDestCubes().isEmpty());
   // Special handling of grouping function
   targetNode = rewriteGroupingFunctionAST(getGroupByForClause(qbp, destClauseName), targetNode,
     !cubeRollupGrpSetPresent);
  }
  gbFilter = genFilterRelNode(qb, targetNode, srcRel, aliasToRel, null, null, true);
 }
 return gbFilter;
}

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

private RelNode genGBHavingLogicalPlan(QB qb, RelNode srcRel, Map<String, RelNode> aliasToRel)
  throws SemanticException {
 RelNode gbFilter = null;
 QBParseInfo qbp = getQBParseInfo(qb);
 String destClauseName = qbp.getClauseNames().iterator().next();
 ASTNode havingClause = qbp.getHavingForClause(qbp.getClauseNames().iterator().next());
 if (havingClause != null) {
  if (!(srcRel instanceof HiveAggregate)) {
   // ill-formed query like select * from t1 having c1 > 0;
   throw new CalciteSemanticException("Having clause without any group-by.",
     UnsupportedFeature.Having_clause_without_any_groupby);
  }
  ASTNode targetNode = (ASTNode) havingClause.getChild(0);
  validateNoHavingReferenceToAlias(qb, targetNode);
  if (!qbp.getDestToGroupBy().isEmpty()) {
   final boolean cubeRollupGrpSetPresent = (!qbp.getDestRollups().isEmpty()
       || !qbp.getDestGroupingSets().isEmpty() || !qbp.getDestCubes().isEmpty());
   // Special handling of grouping function
   targetNode = rewriteGroupingFunctionAST(getGroupByForClause(qbp, destClauseName), targetNode,
     !cubeRollupGrpSetPresent);
  }
  gbFilter = genFilterRelNode(qb, targetNode, srcRel, aliasToRel, null, null, true);
 }
 return gbFilter;
}

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

final String selClauseName = qbp.getClauseNames().iterator().next();
final boolean cubeRollupGrpSetPresent = (!qbp.getDestRollups().isEmpty()
    || !qbp.getDestGroupingSets().isEmpty() || !qbp.getDestCubes().isEmpty());
for (WindowExpressionSpec wExprSpec : windowExpressions) {
 if (!qbp.getDestToGroupBy().isEmpty()) {

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

final String selClauseName = qbp.getClauseNames().iterator().next();
final boolean cubeRollupGrpSetPresent = (!qbp.getDestRollups().isEmpty()
    || !qbp.getDestGroupingSets().isEmpty() || !qbp.getDestCubes().isEmpty());
for (WindowExpressionSpec wExprSpec : windowExpressions) {
 if (!qbp.getDestToGroupBy().isEmpty()) {

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

final boolean cubeRollupGrpSetPresent = (!qb.getParseInfo().getDestRollups().isEmpty()
  || !qb.getParseInfo().getDestGroupingSets().isEmpty()
  || !qb.getParseInfo().getDestCubes().isEmpty());

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

final boolean cubeRollupGrpSetPresent = (!qb.getParseInfo().getDestRollups().isEmpty()
    || !qb.getParseInfo().getDestGroupingSets().isEmpty()
    || !qb.getParseInfo().getDestCubes().isEmpty());

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

final boolean cubeRollupGrpSetPresent = (!qb.getParseInfo().getDestRollups().isEmpty()
  || !qb.getParseInfo().getDestGroupingSets().isEmpty()
  || !qb.getParseInfo().getDestCubes().isEmpty());
for (WindowExpressionSpec wExprSpec : wSpec.getWindowExpressions()) {

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

final boolean cubeRollupGrpSetPresent = (!qb.getParseInfo().getDestRollups().isEmpty()
    || !qb.getParseInfo().getDestGroupingSets().isEmpty()
    || !qb.getParseInfo().getDestCubes().isEmpty());
for (WindowExpressionSpec wExprSpec : wSpec.getWindowExpressions()) {

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

|| !qbp.getDestGroupingSets().isEmpty() || !qbp.getDestCubes().isEmpty());

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

|| !qbp.getDestGroupingSets().isEmpty() || !qbp.getDestCubes().isEmpty());
if (qbp.getDestRollups().contains(detsClauseName)) {
 groupingSets = getGroupingSetsForRollup(grpByAstExprs.size());
} else if (qbp.getDestCubes().contains(detsClauseName)) {
 groupingSets = getGroupingSetsForCube(grpByAstExprs.size());
} else if (qbp.getDestGroupingSets().contains(detsClauseName)) {

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

|| !qbp.getDestGroupingSets().isEmpty() || !qbp.getDestCubes().isEmpty());

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

|| !qb.getParseInfo().getDestCubes().isEmpty());
Set<String> colAliases = new HashSet<String>();
ASTNode[] exprs = new ASTNode[exprList.getChildCount()];

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

|| !qb.getParseInfo().getDestCubes().isEmpty());
Set<String> colAliases = new HashSet<String>();
ASTNode[] exprs = new ASTNode[exprList.getChildCount()];

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

|| !qbp.getDestGroupingSets().isEmpty() || !qbp.getDestCubes().isEmpty());

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

qbp.getDestRollups().add(ctx_1.dest);
} else if (ast.getToken().getType() == HiveParser.TOK_CUBE_GROUPBY) {
 qbp.getDestCubes().add(ctx_1.dest);
} else if (ast.getToken().getType() == HiveParser.TOK_GROUPING_SETS) {
 qbp.getDestGroupingSets().add(ctx_1.dest);

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

qbp.getDestRollups().add(ctx_1.dest);
} else if (ast.getToken().getType() == HiveParser.TOK_CUBE_GROUPBY) {
 qbp.getDestCubes().add(ctx_1.dest);
} else if (ast.getToken().getType() == HiveParser.TOK_GROUPING_SETS) {
 qbp.getDestGroupingSets().add(ctx_1.dest);

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

private ObjectPair<List<ASTNode>, List<Integer>> getGroupByGroupingSetsForClause(
  QBParseInfo parseInfo, String dest) throws SemanticException {
 List<Integer> groupingSets = new ArrayList<Integer>();
 List<ASTNode> groupByExprs = getGroupByForClause(parseInfo, dest);
 if (parseInfo.getDestRollups().contains(dest)) {
  groupingSets = getGroupingSetsForRollup(groupByExprs.size());
 } else if (parseInfo.getDestCubes().contains(dest)) {
  groupingSets = getGroupingSetsForCube(groupByExprs.size());
 } else if (parseInfo.getDestGroupingSets().contains(dest)) {
  groupingSets = getGroupingSets(groupByExprs, parseInfo, dest);
 }
 return new ObjectPair<List<ASTNode>, List<Integer>>(groupByExprs, groupingSets);
}

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

|| !qbp.getDestGroupingSets().isEmpty() || !qbp.getDestCubes().isEmpty());
if (qbp.getDestRollups().contains(detsClauseName)) {
 groupingSets = getGroupingSetsForRollup(grpByAstExprs.size());
} else if (qbp.getDestCubes().contains(detsClauseName)) {
 groupingSets = getGroupingSetsForCube(grpByAstExprs.size());
} else if (qbp.getDestGroupingSets().contains(detsClauseName)) {

相关文章

微信公众号

最新文章

更多

QBParseInfo类方法