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

Method isRefTrivial

core/src/main/java/org/apache/calcite/rel/RelRoot.java:234–243  ·  view source on GitHub ↗

Returns true if the embedded relation is either a DML relation or if the field order defined in this RelRoot is the same as the field order of the embedded relation, otherwise false. Positive example (same order): RelRoot: { rel: Project(name, empno) TableScan(EMP)

()

Source from the content-addressed store, hash-verified

232 * are in the same order as in the embedded relation, otherwise false
233 */
234 public boolean isRefTrivial() {
235 if (SqlKind.DML.contains(kind)) {
236 // DML statements return a single count column.
237 // The validated type is of the SELECT.
238 // Still, we regard the mapping as trivial.
239 return true;
240 }
241 final RelDataType inputRowType = rel.getRowType();
242 return Mappings.isIdentity(fields.leftList(), inputRowType.getFieldCount());
243 }
244
245 /**
246 * Returns true if the embedded relation has a single collation defined which matches the

Callers 4

projectMethod · 0.95
implementMethod · 0.80

Calls 5

isIdentityMethod · 0.95
getFieldCountMethod · 0.95
containsMethod · 0.65
getRowTypeMethod · 0.65
leftListMethod · 0.65