private static int comparePathKeyStrength(Path p1, Path p2, HiveConf conf) throws HiveException {
    try {
      HadoopShims.HdfsEncryptionShim hdfsEncryptionShim1 = SessionState.get().getHdfsEncryptionShim(p1.getFileSystem(conf), conf);
      HadoopShims.HdfsEncryptionShim hdfsEncryptionShim2 = SessionState.get().getHdfsEncryptionShim(p2.getFileSystem(conf), conf);

      if (hdfsEncryptionShim1 != null && hdfsEncryptionShim2 != null) {
        return hdfsEncryptionShim1.comparePathKeyStrength(p1, p2, hdfsEncryptionShim2);
      }
    } catch (Exception e) {
      throw new HiveException("Unable to compare key strength for " + p1 + " and " + p2 + " : " + e, e);
    }

    return 0; // Non-encrypted path (or equals strength)
  }
Compares to path key encryption strenghts.

@param p1 Path to an HDFS file system
@param p2 Path to an HDFS file system
@return -1 if strength is weak; 0 if is equals; 1 if it is stronger
@throws HiveException If an error occurs while comparing key strengths.
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java