public static HiveRelOptMaterialization augmentMaterializationWithTimeInformation(
      HiveRelOptMaterialization materialization, Supplier<String> validTxnsList,
      MaterializationSnapshot snapshot) throws LockException {

    RelNode modifiedQueryRel;
    if (snapshot != null && snapshot.getTableSnapshots() != null && !snapshot.getTableSnapshots().isEmpty()) {
      modifiedQueryRel = applyRule(
              materialization.queryRel, HiveAugmentSnapshotMaterializationRule.with(snapshot.getTableSnapshots()));
    } else {
      String materializationTxnList = snapshot != null ? snapshot.getValidTxnList() : null;
      modifiedQueryRel = augmentMaterializationWithTimeInformation(
              materialization, validTxnsList, ValidTxnWriteIdList.fromValue(materializationTxnList));
    }

    return new HiveRelOptMaterialization(materialization.tableRel, modifiedQueryRel,
            null, materialization.qualifiedTableName, materialization.getScope(), materialization.getRebuildMode(),
            materialization.getAst());
  }
Method to enrich the materialization query contained in the input with
its invalidation.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/views/HiveMaterializedViewUtils.java