code: public static List<String> generateDropPartitionsDDL(final String dbName, final String finalTableName,
        final Map<String, String> partitionsDMLInfo) {
  
      if (null == partitionsDMLInfo || partitionsDMLInfo.isEmpty()) {
        return Collections.emptyList();
      }
  
      // Partition details
      StringBuilder partitionSpecs = new StringBuilder();
      partitionSpecs.append("PARTITION (");
      boolean isFirstPartitionSpec = true;
      for (Map.Entry<String, String> partition : partitionsDMLInfo.entrySet()) {
        if (isFirstPartitionSpec) {
          isFirstPartitionSpec = false;
        } else {
          partitionSpecs.append(", ");
        }
        partitionSpecs.append(String.format("`%s`='%s'", partition.getKey(), partition.getValue()));
      }
      partitionSpecs.append(") ");
  
      List<String> ddls = Lists.newArrayList();
      // Note: Hive does not support fully qualified Hive table names such as db.table for ALTER TABLE in v0.13
      // .. hence specifying 'use dbName' as a precursor to rename
      // Refer: HIVE-2496
      ddls.add(String.format("USE %s%n", dbName));
      ddls.add(String.format("ALTER TABLE %s DROP IF EXISTS %s", finalTableName, partitionSpecs));
  
      return ddls;
    }
docs: Generate DDL for dropping partitions of a table.
  <p>
  ALTER TABLE finalTableName DROP IF EXISTS PARTITION partition_spec, PARTITION partition_spec, ...;
  </p>
  @param finalTableName Table name where partitions are dropped
  @param partitionsDMLInfo Partitions to be dropped
  @return DDL to drop partitions in <code>finalTableName</code>