@Override
  public void onMatch(RelOptRuleCall call) {
    if (triggered) {
      // Bail out
      return;
    }

    RelNode node = call.rel(0);
    final HepRelVertex root = (HepRelVertex) call.getPlanner().getRoot();
    if (root.getCurrentRel() != node) {
      // Bail out
      return;
    }
    // The node is the root, release the kraken!
    node = HiveHepExtractRelNodeRule.execute(node);
    call.transformTo(trim(call, node));
    triggered = true;
  }
Rule that triggers the field trimmer on the root of a plan.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFieldTrimmerRule.java