public static List<PartitionField> getPartitionFields(Table table, boolean latestSpecOnly) {
    return latestSpecOnly ? table.spec().fields() :
      table.specs().values().stream()
        .flatMap(spec -> spec.fields().stream()
            .filter(f -> !f.transform().isVoid()))
        .distinct()
        .collect(Collectors.toList());
  }
Fast forwards a branch to another.
@param table the iceberg table
@param sourceBranch the source branch
@param targetBranch the target branch
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/IcebergTableUtil.java