MCPcopy Create free account
hub / github.com/apache/calcite / explainTerms

Method explainTerms

core/src/main/java/org/apache/calcite/rel/core/Sort.java:262–282  ·  view source on GitHub ↗
(RelWriter pw)

Source from the content-addressed store, hash-verified

260 }
261
262 @Override public RelWriter explainTerms(RelWriter pw) {
263 super.explainTerms(pw);
264 if (pw.nest()) {
265 pw.item("collation", collation);
266 } else {
267 for (Ord<RexNode> ord : Ord.zip(getSortExps())) {
268 pw.item("sort" + ord.i, ord.e);
269 }
270 for (Ord<RelFieldCollation> ord
271 : Ord.zip(collation.getFieldCollations())) {
272 if (!pw.expand()) {
273 pw.item("dir" + ord.i, ord.e.shortString());
274 } else {
275 pw.item("dir" + ord.i, ord.e.fullString());
276 }
277 }
278 }
279 pw.itemIf("offset", offset, offset != null);
280 pw.itemIf("fetch", fetch, fetch != null);
281 return pw;
282 }
283
284 /** Returns the double value of a node if it is a literal, otherwise null. */
285 private static @Nullable Double doubleValue(@Nullable RexNode r) {

Callers

nothing calls this directly

Calls 9

zipMethod · 0.95
getSortExpsMethod · 0.95
shortStringMethod · 0.80
fullStringMethod · 0.80
nestMethod · 0.65
itemMethod · 0.65
getFieldCollationsMethod · 0.65
expandMethod · 0.65
itemIfMethod · 0.65

Tested by

no test coverage detected