本文整理汇总了Java中org.apache.calcite.rel.RelWriter类的典型用法代码示例。如果您正苦于以下问题:Java RelWriter类的具体用法?Java RelWriter怎么用?Java RelWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RelWriter类属于org.apache.calcite.rel包,在下文中一共展示了RelWriter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: done
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
public RelWriter done(RelNode node) {
int i = 0;
if (values.size() > 0 && values.get(0).left.equals("subset")) {
++i;
}
for (RelNode input : node.getInputs()) {
assert values.get(i).right == input;
++i;
}
for (RexNode expr : node.getChildExps()) {
assert values.get(i).right == expr;
++i;
}
final List<Pair<String, Object>> valuesCopy =
ImmutableList.copyOf(values);
values.clear();
explain_(node, valuesCopy);
pw.flush();
return this;
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:21,代码来源:NumberingRelWriter.java
示例2: setPlansWithIds
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
/**
* Generate readable text and json plans and set them in <code>planHolder</code>
* @param rel
* @param explainlevel explain plan level.
* @param observer
*/
public static String setPlansWithIds(final Prel rel, final SqlExplainLevel explainlevel, final AttemptObserver observer, final long millisTaken) {
if (rel == null) {
return null;
}
Map<Prel, OpId> relIdMap = getIdMap(rel);
final StringWriter sw = new StringWriter();
final RelWriter textPlanWriter = new NumberingRelWriter(relIdMap, new PrintWriter(sw), explainlevel);
rel.explain(textPlanWriter);
final String textPlan = sw.toString();
observer.planText(sw.toString(), millisTaken);
final RelJsonWriter jsonPlanWriter = new RelJsonWriter(getIdMap(rel), explainlevel);
rel.explain(jsonPlanWriter);
observer.planJsonPlan(jsonPlanWriter.asString());
return textPlan;
}
开发者ID:dremio,项目名称:dremio-oss,代码行数:24,代码来源:PrelSequencer.java
示例3: explainTerms
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
@Override
public RelWriter explainTerms(RelWriter pw) {
pw.item("table", tableMetadata.getName());
if(projectedColumns != null){
pw.item("columns", FluentIterable.from(projectedColumns).transform(new Function<SchemaPath, String>(){
@Override
public String apply(SchemaPath input) {
return input.toString();
}}).join(Joiner.on(", ")));
}
pw.item("splits", getTableMetadata().getSplitCount());
if(observedRowcountAdjustment != 1.0d){
pw.item("rowAdjust", observedRowcountAdjustment);
}
return pw;
}
开发者ID:dremio,项目名称:dremio-oss,代码行数:21,代码来源:ScanRelBase.java
示例4: explainTerms
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
public RelWriter explainTerms(RelWriter pw) {
// We skip the "groups" element if it is a singleton of "group".
pw.item("group", groupSet)
.itemIf("window", windowFn, windowFn != null)
.itemIf("trigger", trigger, trigger != null)
.itemIf("event_time", windowFieldIdx, windowFieldIdx != -1)
.itemIf("groups", groupSets, getGroupType() != Group.SIMPLE)
.itemIf("indicator", indicator, indicator)
.itemIf("aggs", aggCalls, pw.nest());
if (!pw.nest()) {
for (Ord<AggregateCall> ord : Ord.zip(aggCalls)) {
pw.item(Util.first(ord.e.name, "agg#" + ord.i), ord.e);
}
}
return pw;
}
开发者ID:apache,项目名称:beam,代码行数:17,代码来源:BeamAggregationRel.java
示例5: explainTerms
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
public RelWriter explainTerms(RelWriter pw) {
super.explainTerms(pw);
assert fieldExps.size() == collation.getFieldCollations().size();
if (pw.nest()) {
pw.item("collation", collation);
} else {
for (Ord<RexNode> ord : Ord.zip(fieldExps)) {
pw.item("sort" + ord.i, ord.e);
}
for (Ord<RelFieldCollation> ord
: Ord.zip(collation.getFieldCollations())) {
pw.item("dir" + ord.i, ord.e.shortString());
}
}
pw.itemIf("offset", offset, offset != null);
pw.itemIf("fetch", fetch, fetch != null);
return pw;
}
开发者ID:apache,项目名称:calcite,代码行数:19,代码来源:Sort.java
示例6: explainTerms
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
public RelWriter explainTerms(RelWriter pw) {
return super.explainTerms(pw)
.itemIf("type", this.rowType, pw.getDetailLevel() == SqlExplainLevel.DIGEST_ATTRIBUTES)
.itemIf("type", this.rowType.getFieldList(), pw.nest())
.itemIf("tuplesCount", rowCount, pw.getDetailLevel() != SqlExplainLevel.ALL_ATTRIBUTES)
.itemIf("tuples", options.asNode(), pw.getDetailLevel() == SqlExplainLevel.ALL_ATTRIBUTES);
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:8,代码来源:DrillValuesRel.java
示例7: printWithIds
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
public static String printWithIds(final Prel rel, SqlExplainLevel explainlevel) {
if (rel == null) {
return null;
}
final StringWriter sw = new StringWriter();
final RelWriter planWriter = new NumberingRelWriter(getIdMap(rel), new PrintWriter(sw), explainlevel);
rel.explain(planWriter);
return sw.toString();
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:11,代码来源:PrelSequencer.java
示例8: explainTerms
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
@Override
public RelWriter explainTerms(RelWriter pw) {
super.explainTerms(pw);
if (pw.nest()) {
pw.item("collation", collation);
} else {
for (Ord<RelFieldCollation> ord : Ord.zip(collation.getFieldCollations())) {
pw.item("sort" + ord.i, ord.e);
}
}
return pw;
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:13,代码来源:SingleMergeExchangePrel.java
示例9: explainTerms
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
@Override
public RelWriter explainTerms(RelWriter pw) {
super.explainTerms(pw);
for (Ord<DistributionField> ord : Ord.zip(fields)) {
pw.item("dist" + ord.i, ord.e);
}
return pw;
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:9,代码来源:HashToRandomExchangePrel.java
示例10: explainTerms
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
@Override
public RelWriter explainTerms(RelWriter pw) {
super.explainTerms(pw);
pw.itemIf("offset", offset, offset != null);
pw.itemIf("fetch", fetch, fetch != null);
return pw;
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:8,代码来源:DrillLimitRelBase.java
示例11: explainTerms
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
@Override
public RelWriter explainTerms(RelWriter pw) {
return super.explainTerms(pw)
.itemIf("type", this.rowType, pw.getDetailLevel() == SqlExplainLevel.DIGEST_ATTRIBUTES)
.itemIf("type", this.rowType.getFieldList(), pw.nest())
.itemIf("tuplesCount", rowCount, pw.getDetailLevel() != SqlExplainLevel.ALL_ATTRIBUTES)
.itemIf("tuples", options.asNode(), pw.getDetailLevel() == SqlExplainLevel.DIGEST_ATTRIBUTES);
}
开发者ID:dremio,项目名称:dremio-oss,代码行数:9,代码来源:ValuesRel.java
示例12: itemIf
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
@Override
public RelWriter itemIf(String term, Object value, boolean condition) {
if (condition) {
item(term, value);
}
return this;
}
开发者ID:dremio,项目名称:dremio-oss,代码行数:8,代码来源:RelJsonWriter.java
示例13: done
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
@Override
public RelWriter done(RelNode node) {
final List<Pair<String, Object>> valuesCopy =
ImmutableList.copyOf(values);
values.clear();
explain_(node, valuesCopy);
return this;
}
开发者ID:dremio,项目名称:dremio-oss,代码行数:9,代码来源:RelJsonWriter.java
示例14: explainTerms
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
@Override
public RelWriter explainTerms(RelWriter pw) {
if (content.isOpaque()) {
return super.explainTerms(pw).item("Key", content.hashCode());
} else {
return super.explainTerms(pw).item("Values", content.asNode());
}
}
开发者ID:dremio,项目名称:dremio-oss,代码行数:9,代码来源:ValuesPrel.java
示例15: explainTerms
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
@Override
public RelWriter explainTerms(RelWriter pw) {
pw = super.explainTerms(pw);
if(conditions != null && !conditions.isEmpty()){
return pw.item("filters", conditions);
}
return pw;
}
开发者ID:dremio,项目名称:dremio-oss,代码行数:9,代码来源:FilesystemScanDrel.java
示例16: explainTerms
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
@Override
public RelWriter explainTerms(RelWriter pw) {
boolean contextNotNull = context != null;
return super.explainTerms(pw)
.item("ctx", context == null ? "" : String.valueOf(context.id) + "@" + context.realization)
.itemIf("all", all, true);
}
开发者ID:apache,项目名称:kylin,代码行数:9,代码来源:OLAPUnionRel.java
示例17: explainTerms
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
@Override
public RelWriter explainTerms(RelWriter pw) {
return super.explainTerms(pw)
.item("ctx", context == null ? "" : String.valueOf(context.id) + "@" + context.realization)//
.itemIf("constants", constants, !constants.isEmpty()) //
.itemIf("groups", groups, !groups.isEmpty());
}
开发者ID:apache,项目名称:kylin,代码行数:9,代码来源:OLAPWindowRel.java
示例18: explainTerms
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
@Override
public RelWriter explainTerms(RelWriter pw) {
return super.explainTerms(pw)
.item("ctx", context == null ? "" : String.valueOf(context.id) + "@" + context.realization)
.item("fields", Primitive.asList(fields));
}
开发者ID:apache,项目名称:kylin,代码行数:8,代码来源:OLAPTableScan.java
示例19: explainTerms
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
@Override public RelWriter explainTerms(RelWriter pw) {
return super.explainTerms(pw)
.item("table", table.getQualifiedName())
.item("earliest", earliest)
.item("latest", latest)
.item("fieldList", fieldList);
}
开发者ID:apache,项目名称:calcite,代码行数:8,代码来源:SplunkTableScan.java
示例20: done
import org.apache.calcite.rel.RelWriter; //导入依赖的package包/类
public RelWriter done(RelNode node) {
final List<Pair<String, Object>> valuesCopy =
ImmutableList.copyOf(values);
values.clear();
explain_(node, valuesCopy);
return this;
}
开发者ID:apache,项目名称:calcite,代码行数:8,代码来源:RelJsonWriter.java
注:本文中的org.apache.calcite.rel.RelWriter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论