@Override
  public void ruleAttempted(final RuleAttemptedEvent event) {
    if (event.isBefore() && LOG.isDebugEnabled()) {
      RelOptRuleCall call = event.getRuleCall();
      String ruleArgs = Arrays.stream(call.rels).map(rel -> "rel#" + rel.getId() + ":" + rel.getRelTypeName())
          .collect(Collectors.joining(","));
      LOG.debug("call#{}: Apply rule [{}] to [{}]", call.id, call.getRule(), ruleArgs);
    }
  }
Listener for logging useful debugging information on certain rule events.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/RuleEventLogger.java