/** * Writes an explanation of the expressions in this program to a plan * writer. * * @param pw Plan writer */ public RelWriter explainCalc(RelWriter pw) { return collectExplainTerms("", pw, pw.getDetailLevel()); }
/** * Writes an explanation of the expressions in this program to a plan * writer. * * @param pw Plan writer */ public RelWriter explainCalc(RelWriter pw) { return collectExplainTerms("", pw, pw.getDetailLevel()); }
@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); }
@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); } // we need to include the table metadata digest since not all properties (specifically which splits) are included in the explain output (what base computeDigest uses). pw.itemIf("tableDigest", tableMetadata.computeDigest(), pw.getDetailLevel() == SqlExplainLevel.DIGEST_ATTRIBUTES); return pw; }
public RelWriter explainTerms(RelWriter pw) { // A little adapter just to get the tuples to come out // with curly brackets instead of square brackets. Plus // more whitespace for readability. return super.explainTerms(pw) // For rel digest, include the row type since a rendered // literal may leave the type ambiguous (e.g. "null"). .itemIf("type", rowType, pw.getDetailLevel() == SqlExplainLevel.DIGEST_ATTRIBUTES) .itemIf("type", rowType.getFieldList(), pw.nest()) .itemIf("tuples", Lists.transform(tuples, Values::apply), !pw.nest()) .itemIf("tuples", tuples, pw.nest()); } }
public RelWriter explainTerms(RelWriter pw) { // A little adapter just to get the tuples to come out // with curly brackets instead of square brackets. Plus // more whitespace for readability. return super.explainTerms(pw) // For rel digest, include the row type since a rendered // literal may leave the type ambiguous (e.g. "null"). .itemIf("type", rowType, pw.getDetailLevel() == SqlExplainLevel.DIGEST_ATTRIBUTES) .itemIf("type", rowType.getFieldList(), pw.nest()) .itemIf("tuples", Lists.transform(tuples, Values::apply), !pw.nest()) .itemIf("tuples", tuples, pw.nest()); } }
public RelWriter explainTerms(RelWriter pw) { super.explainTerms(pw); if (pw.nest()) { pw.item("fields", rowType.getFieldNames()); pw.item("exprs", exps); } else { for (Ord<RelDataTypeField> field : Ord.zip(rowType.getFieldList())) { String fieldName = field.e.getName(); if (fieldName == null) { fieldName = "field#" + field.i; } pw.item(fieldName, exps.get(field.i)); } } // If we're generating a digest, include the rowtype. If two projects // differ in return type, we don't want to regard them as equivalent, // otherwise we will try to put rels of different types into the same // planner equivalence set. //CHECKSTYLE: IGNORE 2 if ((pw.getDetailLevel() == SqlExplainLevel.DIGEST_ATTRIBUTES) && false) { pw.item("type", rowType); } return pw; }
public RelWriter explainTerms(RelWriter pw) { super.explainTerms(pw); if (pw.nest()) { pw.item("fields", rowType.getFieldNames()); pw.item("exprs", exps); } else { for (Ord<RelDataTypeField> field : Ord.zip(rowType.getFieldList())) { String fieldName = field.e.getName(); if (fieldName == null) { fieldName = "field#" + field.i; } pw.item(fieldName, exps.get(field.i)); } } // If we're generating a digest, include the rowtype. If two projects // differ in return type, we don't want to regard them as equivalent, // otherwise we will try to put rels of different types into the same // planner equivalence set. //CHECKSTYLE: IGNORE 2 if ((pw.getDetailLevel() == SqlExplainLevel.DIGEST_ATTRIBUTES) && false) { pw.item("type", rowType); } return pw; }