private static Map<String, SnapshotContext> getSnapshotOf(Hive db, Set<TableName> tables) throws HiveException {
    Map<String, SnapshotContext> snapshot = new HashMap<>(tables.size());
    for (TableName tableName : tables) {
      Table table = db.getTable(tableName);
      if (table.getStorageHandler() != null) {
        HiveStorageHandler storageHandler = table.getStorageHandler();
        if (!storageHandler.areSnapshotsSupported()) {
          return Collections.emptyMap();
        }
        snapshot.put(table.getFullyQualifiedName(), storageHandler.getCurrentSnapshotContext(table));
      } else {
        return Collections.emptyMap();
      }
    }
    return snapshot;
  }
Validate if given materialized view has SELECT privileges for current user
@param cachedMVTableList
@return false if user does not have privilege otherwise true
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/views/HiveMaterializedViewUtils.java