public static void dropBranch(Table table, AlterTableSnapshotRefSpec.DropSnapshotRefSpec dropBranchSpec) {
    String branchName = dropBranchSpec.getRefName();
    boolean ifExists = dropBranchSpec.getIfExists();

    SnapshotRef snapshotRef = table.refs().get(branchName);
    if (snapshotRef != null || !ifExists) {
      LOG.info("Dropping branch {} on iceberg table {}", branchName, table.name());
      table.manageSnapshots().removeBranch(branchName).commit();
    }
  }
Create a branch on the iceberg table
@param table the iceberg table
@param createBranchSpec Get the basic parameters needed to create a branch
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/IcebergSnapshotRefExec.java