@Override
    public int compareTo(CacheTag o) {
      if (o == null) {
        return 1;
      }
      if (o instanceof TableCacheTag) {
        return 1;
      } else if (o instanceof MultiPartitionCacheTag) {
        return -1;
      }
      SinglePartitionCacheTag other = (SinglePartitionCacheTag) o;
      int tableNameDiff = super.compareTo(other);
      if (tableNameDiff != 0) {
        return tableNameDiff;
      } else {
        return partitionDesc.compareTo(other.partitionDesc);
      }
    }
CacheTag for tables with exactly one partition level.
storage-api/src/java/org/apache/hadoop/hive/common/io/CacheTag.java