@Override
  public void onMatch(RelOptRuleCall call) {
    final Union union = call.rel(0);
    // First branch is query, second branch is MV
    RelNode newNode = call.builder()
        .push(union.getInput(0))
        .convert(union.getRowType(), false)
        .build();
    call.transformTo(newNode);
  }
This rule will perform a rewriting to prepare the plan for incremental
view maintenance in case there is no aggregation operator, so we can
avoid the INSERT OVERWRITE and use a INSERT statement instead.
In particular, it removes the union branch that reads the old data from
the materialization, and keeps the branch that will read the new data.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/views/HiveJoinInsertIncrementalRewritingRule.java