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


Java SqlExplainLevel.NO_ATTRIBUTES属性代码示例

本文整理汇总了Java中org.apache.calcite.sql.SqlExplainLevel.NO_ATTRIBUTES属性的典型用法代码示例。如果您正苦于以下问题:Java SqlExplainLevel.NO_ATTRIBUTES属性的具体用法?Java SqlExplainLevel.NO_ATTRIBUTES怎么用?Java SqlExplainLevel.NO_ATTRIBUTES使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.calcite.sql.SqlExplainLevel的用法示例。


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

示例1: explain_

protected void explain_(
    RelNode rel,
    List<Pair<String, Object>> values) {
  List<RelNode> inputs = rel.getInputs();
  if (rel instanceof HashJoinPrel && ((HashJoinPrel) rel).isSwapped()) {
    HashJoinPrel joinPrel = (HashJoinPrel) rel;
    inputs = FlatLists.of(joinPrel.getRight(), joinPrel.getLeft());
  }

  if (!RelMetadataQuery.isVisibleInExplain(
      rel,
      detailLevel)) {
    // render children in place of this, at same level
    explainInputs(inputs);
    return;
  }

  StringBuilder s = new StringBuilder();
  OpId id = ids.get(rel);
  if (id != null) {
    s.append(String.format("%02d-%02d", id.fragmentId, id.opId));
  }else{
    s.append("     ");
  }
  s.append("  ");

  if (id != null && id.opId == 0) {
    for(int i =0; i < spacer.get(); i++){ s.append('-');}
  }else{
    spacer.spaces(s);
  }

  s.append("  ");

  s.append(rel.getRelTypeName().replace("Prel", ""));
  if (detailLevel != SqlExplainLevel.NO_ATTRIBUTES) {
    int j = 0;
    for (Pair<String, Object> value : values) {
      if (value.right instanceof RelNode) {
        continue;
      }
      if (j++ == 0) {
        s.append("(");
      } else {
        s.append(", ");
      }
      s.append(value.left)
          .append("=[")
          .append(value.right)
          .append("]");
    }
    if (j > 0) {
      s.append(")");
    }
  }
  if (detailLevel == SqlExplainLevel.ALL_ATTRIBUTES) {
    s.append(" : rowType = " + rel.getRowType().toString());
    s.append(": rowcount = ")
        .append(RelMetadataQuery.getRowCount(rel))
        .append(", cumulative cost = ")
        .append(RelMetadataQuery.getCumulativeCost(rel));
     s.append(", id = ").append(rel.getId());
  }
  pw.println(s);
  spacer.add(2);
  explainInputs(inputs);
  spacer.subtract(2);
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:68,代码来源:NumberingRelWriter.java

示例2: explain_

protected void explain_(
    RelNode rel,
    List<Pair<String, Object>> values) {
  List<RelNode> inputs = rel.getInputs();
  RelMetadataQuery mq = RelMetadataQuery.instance(DefaultRelMetadataProvider.INSTANCE);
  if (rel instanceof HashJoinPrel && ((HashJoinPrel) rel).isSwapped()) {
    HashJoinPrel joinPrel = (HashJoinPrel) rel;
    inputs = FlatLists.of(joinPrel.getRight(), joinPrel.getLeft());
  }

  if (!mq.isVisibleInExplain(rel, detailLevel)) {
    // render children in place of this, at same level
    explainInputs(inputs);
    return;
  }

  StringBuilder s = new StringBuilder();
  OpId id = ids.get(rel);
  if (id != null) {
    s.append(String.format("%02d-%02d", id.fragmentId, id.opId));
  }else{
    s.append("     ");
  }
  s.append("  ");

  if (id != null && id.opId == 0) {
    for(int i =0; i < spacer.get(); i++){ s.append('-');}
  }else{
    spacer.spaces(s);
  }

  s.append("  ");

  s.append(rel.getRelTypeName().replace("Prel", ""));
  if (detailLevel != SqlExplainLevel.NO_ATTRIBUTES) {
    int j = 0;
    for (Pair<String, Object> value : values) {
      if (value.right instanceof RelNode) {
        continue;
      }
      if (j++ == 0) {
        s.append("(");
      } else {
        s.append(", ");
      }
      s.append(value.left)
          .append("=[")
          .append(value.right)
          .append("]");
    }
    if (j > 0) {
      s.append(")");
    }
  }
  if (detailLevel == SqlExplainLevel.ALL_ATTRIBUTES) {
    s.append(" : rowType = " + rel.getRowType().toString());
    s.append(": rowcount = ")
        .append(mq.getRowCount(rel))
        .append(", cumulative cost = ")
        .append(mq.getCumulativeCost(rel));
     s.append(", id = ").append(rel.getId());
  }
  pw.println(s);
  spacer.add(2);
  explainInputs(inputs);
  spacer.subtract(2);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:67,代码来源:NumberingRelWriter.java

示例3: explain_

protected void explain_(
    RelNode rel,
    List<Pair<String, Object>> values) {
  List<RelNode> inputs = rel.getInputs();
  if (rel instanceof HashJoinPrel && ((HashJoinPrel) rel).isSwapped()) {
    HashJoinPrel joinPrel = (HashJoinPrel) rel;
    inputs = FlatLists.of(joinPrel.getRight(), joinPrel.getLeft());
  }

  RelMetadataQuery mq = RelMetadataQuery.instance();
  if (!mq.isVisibleInExplain(rel, detailLevel)) {
    // render children in place of this, at same level
    explainInputs(inputs);
    return;
  }

  StringBuilder s = new StringBuilder();
  OpId id = ids.get(rel);
  if (id != null) {
    s.append(String.format("%02d-%02d", id.fragmentId, id.opId));
  }else{
    s.append("     ");
  }
  s.append("  ");

  if (id != null && id.opId == 0) {
    for(int i =0; i < spacer.get(); i++){ s.append('-');}
  }else{
    spacer.spaces(s);
  }

  s.append("  ");

  s.append(rel.getRelTypeName().replace("Prel", ""));
  if (detailLevel != SqlExplainLevel.NO_ATTRIBUTES) {
    int j = 0;
    for (Pair<String, Object> value : values) {
      if (value.right instanceof RelNode) {
        continue;
      }
      if (j++ == 0) {
        s.append("(");
      } else {
        s.append(", ");
      }
      s.append(value.left)
          .append("=[")
          .append(value.right)
          .append("]");
    }
    if (j > 0) {
      s.append(")");
    }
  }
  if (detailLevel == SqlExplainLevel.ALL_ATTRIBUTES) {
    s.append(" : rowType = ")
      .append(rel.getRowType())
      .append(": rowcount = ")
      .append(mq.getRowCount(rel))
      .append(", cumulative cost = ")
      .append(mq.getCumulativeCost(rel))
      .append(", id = ")
      .append(rel.getId());
  }
  pw.println(s);
  spacer.add(2);
  explainInputs(inputs);
  spacer.subtract(2);
}
 
开发者ID:axbaretto,项目名称:drill,代码行数:69,代码来源:NumberingRelWriter.java

示例4: explain_

protected void explain_(RelNode rel,
    List<Pair<String, Object>> values) {
  List<RelNode> inputs = rel.getInputs();
  final RelMetadataQuery mq = rel.getCluster().getMetadataQuery();
  if (!mq.isVisibleInExplain(rel, detailLevel)) {
    // render children in place of this, at same level
    explainInputs(inputs);
    return;
  }

  StringBuilder s = new StringBuilder();
  spacer.spaces(s);
  if (withIdPrefix) {
    s.append(rel.getId()).append(":");
  }
  s.append(rel.getRelTypeName());
  if (detailLevel != SqlExplainLevel.NO_ATTRIBUTES) {
    int j = 0;
    for (Pair<String, Object> value : values) {
      if (value.right instanceof RelNode) {
        continue;
      }
      if (j++ == 0) {
        s.append("(");
      } else {
        s.append(", ");
      }
      s.append(value.left)
          .append("=[")
          .append(value.right)
          .append("]");
    }
    if (j > 0) {
      s.append(")");
    }
  }
  switch (detailLevel) {
  case ALL_ATTRIBUTES:
    s.append(": rowcount = ")
        .append(mq.getRowCount(rel))
        .append(", cumulative cost = ")
        .append(mq.getCumulativeCost(rel));
  }
  switch (detailLevel) {
  case NON_COST_ATTRIBUTES:
  case ALL_ATTRIBUTES:
    if (!withIdPrefix) {
      // If we didn't print the rel id at the start of the line, print
      // it at the end.
      s.append(", id = ").append(rel.getId());
    }
    break;
  }
  pw.println(s);
  spacer.add(2);
  explainInputs(inputs);
  spacer.subtract(2);
}
 
开发者ID:apache,项目名称:calcite,代码行数:58,代码来源:RelWriterImpl.java


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