public List<Partition> getPartitions(Table tbl) throws HiveException {
    PerfLogger perfLogger = SessionState.getPerfLogger();
    perfLogger.perfLogBegin(CLASS_NAME, PerfLogger.HIVE_GET_PARTITIONS);
    try {
      if (tbl.hasNonNativePartitionSupport()) {
        return tbl.getStorageHandler().getPartitions(tbl);
      } else {
        int batchSize = MetastoreConf.getIntVar(conf, MetastoreConf.ConfVars.BATCH_RETRIEVE_MAX);
        return new ArrayList<>(getAllPartitionsInBatches(tbl, batchSize, DEFAULT_BATCH_DECAYING_FACTOR, MetastoreConf
                .getIntVar(conf, MetastoreConf.ConfVars.GETPARTITIONS_BATCH_MAX_RETRIES),
            null, true, getUserName(), getGroupNames())); 
      }
    } finally {
      perfLogger.perfLogEnd(CLASS_NAME, PerfLogger.HIVE_GET_PARTITIONS, "HS2-cache");
    }
  }
get all the partitions that the table has along with auth info

@param tbl
         object for which partition is needed
@return list of partition objects along with auth info
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java