private static RelNode augmentMaterializationWithTimeInformation(
      HiveRelOptMaterialization materialization, Supplier<String>  validTxnsList,
      ValidTxnWriteIdList materializationTxnList) throws LockException {
    // Extract tables used by the query which will in turn be used to generate
    // the corresponding txn write ids
    List<String> tablesUsed = new ArrayList<>();
    new RelVisitor() {
      @Override
      public void visit(RelNode node, int ordinal, RelNode parent) {
        if (node instanceof TableScan) {
          TableScan ts = (TableScan) node;
          tablesUsed.add(((RelOptHiveTable) ts.getTable()).getHiveTableMD().getFullyQualifiedName());
        }
        super.visit(node, ordinal, parent);
      }
    }.go(materialization.queryRel);
    ValidTxnWriteIdList currentTxnList =
        SessionState.get().getTxnMgr().getValidWriteIds(tablesUsed, validTxnsList.get());
    // Augment
    final RexBuilder rexBuilder = materialization.queryRel.getCluster().getRexBuilder();
    return applyRule(
            materialization.queryRel, new HiveAugmentMaterializationRule(rexBuilder, currentTxnList, materializationTxnList));
  }
Method to enrich the materialization query contained in the input with
its invalidation when materialization has native acid source tables.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/views/HiveMaterializedViewUtils.java