/** Returns a string representation of this collation, suitably terse given * that it will appear in plan traces. Examples: * "[]", "[2]", "[0 DESC, 1]", "[0 DESC, 1 ASC NULLS LAST]". */ public String toString() { Iterator<RelFieldCollation> it = fieldCollations.iterator(); if (! it.hasNext()) { return "[]"; } StringBuilder sb = new StringBuilder(); sb.append('['); for (;;) { RelFieldCollation e = it.next(); sb.append(e.getFieldIndex()); if (e.direction != RelFieldCollation.Direction.ASCENDING || e.nullDirection != e.direction.defaultNullDirection()) { sb.append(' ').append(e.shortString()); } if (!it.hasNext()) { return sb.append(']').toString(); } sb.append(',').append(' '); } }
/** Returns a string representation of this collation, suitably terse given * that it will appear in plan traces. Examples: * "[]", "[2]", "[0 DESC, 1]", "[0 DESC, 1 ASC NULLS LAST]". */ public String toString() { Iterator<RelFieldCollation> it = fieldCollations.iterator(); if (! it.hasNext()) { return "[]"; } StringBuilder sb = new StringBuilder(); sb.append('['); for (;;) { RelFieldCollation e = it.next(); sb.append(e.getFieldIndex()); if (e.direction != RelFieldCollation.Direction.ASCENDING || e.nullDirection != e.direction.defaultNullDirection()) { sb.append(' ').append(e.shortString()); } if (!it.hasNext()) { return sb.append(']').toString(); } sb.append(',').append(' '); } }
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; } }
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; } }
pw.item("dir" + ord.i, ord.e.shortString());
pw.item("dir" + ord.i, ord.e.shortString());