com.facebook.presto.sql.tree.Union.getRelations()方法的使用及代码示例

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

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

Union.getRelations介绍

暂无

代码示例

代码示例来源:origin: prestodb/presto

@Override
protected Void visitUnion(Union node, Integer indent)
{
  Iterator<Relation> relations = node.getRelations().iterator();
  while (relations.hasNext()) {
    processRelation(relations.next(), indent);
    if (relations.hasNext()) {
      builder.append("UNION ");
      if (!node.isDistinct()) {
        builder.append("ALL ");
      }
    }
  }
  return null;
}

代码示例来源:origin: prestodb/presto

@Override
protected RelationPlan visitUnion(Union node, Void context)
{
  checkArgument(!node.getRelations().isEmpty(), "No relations specified for UNION");
  SetOperationPlan setOperationPlan = process(node);
  PlanNode planNode = new UnionNode(idAllocator.getNextId(), setOperationPlan.getSources(), setOperationPlan.getSymbolMapping(), ImmutableList.copyOf(setOperationPlan.getSymbolMapping().keySet()));
  if (node.isDistinct()) {
    planNode = distinct(planNode);
  }
  return new RelationPlan(planNode, analysis.getScope(node), planNode.getOutputSymbols());
}

代码示例来源:origin: rakam-io/rakam

@Override
protected Void visitUnion(Union node, Integer indent) {
  Iterator<Relation> relations = node.getRelations().iterator();
  while (relations.hasNext()) {
    processRelation(relations.next(), indent);
    if (relations.hasNext()) {
      builder.append("UNION ");
      if (!node.isDistinct()) {
        builder.append("ALL ");
      }
    }
  }
  return null;
}

代码示例来源:origin: rakam-io/rakam

statement.getLimit(), statement.getOrderBy().map(v -> v.getSortItems()).orElse(null), map);
} else if (statement.getQueryBody() instanceof Union) {
  Relation relation = ((Union) statement.getQueryBody()).getRelations().get(0);
  while (relation instanceof Union) {
    relation = ((Union) relation).getRelations().get(0);

代码示例来源:origin: uk.co.nichesolutions.presto/presto-parser

@Override
protected R visitUnion(Union node, C context)
{
  for (Relation relation : node.getRelations()) {
    process(relation, context);
  }
  return null;
}

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

@Override
protected Void visitUnion(Union node, Integer indent)
{
  Iterator<Relation> relations = node.getRelations().iterator();
  while (relations.hasNext()) {
    processRelation(relations.next(), indent);
    if (relations.hasNext()) {
      builder.append("UNION ");
      if (!node.isDistinct()) {
        builder.append("ALL ");
      }
    }
  }
  return null;
}

代码示例来源:origin: uk.co.nichesolutions.presto/presto-parser

@Override
protected Void visitUnion(Union node, Integer indent)
{
  Iterator<Relation> relations = node.getRelations().iterator();
  while (relations.hasNext()) {
    processRelation(relations.next(), indent);
    if (relations.hasNext()) {
      builder.append("UNION ");
      if (!node.isDistinct()) {
        builder.append("ALL ");
      }
    }
  }
  return null;
}

代码示例来源:origin: vqtran/EchoQuery

@Override
protected Void visitUnion(Union node, Integer indent)
{
  Iterator<Relation> relations = node.getRelations().iterator();
  while (relations.hasNext()) {
    processRelation(relations.next(), indent);
    if (relations.hasNext()) {
      builder.append("UNION ");
      if (!node.isDistinct()) {
        builder.append("ALL ");
      }
    }
  }
  return null;
}

代码示例来源:origin: uk.co.nichesolutions.presto/presto-main

@Override
protected RelationType visitUnion(Union node, AnalysisContext context)
  checkState(node.getRelations().size() >= 2);
  RelationType[] descriptors = node.getRelations().stream()
      .map(relation -> process(relation, context).withOnlyVisibleFields())
      .toArray(RelationType[]::new);
  analysis.setOutputDescriptor(node, outputDescriptor);
  for (int i = 0; i < node.getRelations().size(); i++) {
    Relation relation = node.getRelations().get(i);
    RelationType descriptor = descriptors[i];
    for (int j = 0; j < descriptor.getVisibleFields().size(); j++) {

代码示例来源:origin: uk.co.nichesolutions.presto/presto-main

@Override
protected RelationPlan visitUnion(Union node, Void context)
  checkArgument(!node.getRelations().isEmpty(), "No relations specified for UNION");
  List<RelationPlan> subPlans = node.getRelations().stream()
      .map(relation -> processAndCoerceIfNecessary(relation, context))
      .collect(toImmutableList());

相关文章

微信公众号

最新文章

更多