public List<Partition> dropPartitions(String dbName, String tableName,
      List<Pair<Integer, byte[]>> partitionExpressions,
      PartitionDropOptions dropOptions) throws HiveException {
    try {
      Table table = getTable(dbName, tableName);
      if (!dropOptions.deleteData) {
        AcidUtils.TableSnapshot snapshot = AcidUtils.getTableSnapshot(conf, table, true);
        if (snapshot != null) {
          dropOptions.setWriteId(snapshot.getWriteId());
        }
        long txnId = Optional.ofNullable(SessionState.get())
          .map(ss -> ss.getTxnMgr().getCurrentTxnId()).orElse(0L);
        dropOptions.setTxnId(txnId);
      }
      List<org.apache.hadoop.hive.metastore.api.Partition> partitions = getMSC().dropPartitions(dbName, tableName,
          partitionExpressions, dropOptions);
      return convertFromMetastore(table, partitions);
    } catch (NoSuchObjectException e) {
      throw new HiveException("Partition or table doesn't exist.", e);
    } catch (Exception e) {
      throw new HiveException(e.getMessage(), e);
    }
  }
This method helps callers trigger an INSERT event for DML queries without having to deal with
HMS objects. This takes java object types as arguments.
@param dbName Name of the hive database this table belongs to.
@param tblName Name of the hive table this event is for.
@param partitionSpec Map containing key/values for each partition column. Can be null if the event is for a table
@param replace boolean to indicate whether the filelist is replacement of existing files. Treated as additions otherwise
@param newFiles List of file paths affected (added/replaced) by this DML query. Can be null
@throws HiveException if the table or partition does not exist or other internal errors in fetching them
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java