@Override
  public List<RelNode> suggest(final RelNode input, final Configuration configuration) {
    List<RelNode> result = internal.suggest(input, configuration);
    // Ensure CTEs are printed deterministically to avoid test flakiness
    result.stream().map(RelOptUtil::toString).sorted()
        .forEach(cte -> SessionState.getConsole().printInfo("CTE Suggestion:\n" + cte, false));
    return result;
  }
Suggester for printing common table expressions to the Session's console.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/CommonTableExpressionPrintSuggester.java