public static Boolean isOutdatedMaterializedView(
      Supplier<String> validTxnsList, HiveTxnManager txnMgr, Hive db,
      Set<TableName> tablesUsed, Table materializedViewTable) throws HiveException {

    MaterializedViewMetadata mvMetadata = materializedViewTable.getMVMetadata();
    MaterializationSnapshot snapshot = mvMetadata.getSnapshot();

    if (snapshot != null && snapshot.getTableSnapshots() != null && !snapshot.getTableSnapshots().isEmpty()) {
      return isOutdatedMaterializedView(snapshot, db, tablesUsed, materializedViewTable);
    }
    String txnString = validTxnsList.get();
    if (txnString == null) {
      return null;
    }
    String materializationTxnList = snapshot != null ? snapshot.getValidTxnList() : null;
    
    return isOutdatedMaterializedView(
        materializationTxnList, txnString, txnMgr, tablesUsed, materializedViewTable);
  }
Utility method that returns whether a materialized view is outdated (true), not outdated
(false), or it cannot be determined (null). The latest case may happen e.g. when the
materialized view definition uses external tables.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/views/HiveMaterializedViewUtils.java