本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}