public static Set<String> getUniqueNames(List<Pair<String, String>> tables) {
    Set<String> names = new HashSet<>();
    for (Pair<String, String> table : tables) {
      names.add(getTableName(table));
    }
    return names;
  }
Get the unique names from a table list. The list may contain some cases where
both the dbname and tablename are provided and some cases where the dbname is
null, in which case we need to grab the dbname from the SessionState.
ql/src/java/org/apache/hadoop/hive/ql/parse/CacheTableHelper.java