class TablesOutputDataTransformer extends OutputDataTransformer<TableMetadataUnit> {

  @Override
  public List<TableMetadataUnit> execute() {
    List<TableMetadataUnit> results = new ArrayList<>();
    for (Map<MethodHandle, Object> valueToSet : valuesToSet()) {
      TableMetadataUnit.Builder builder = TableMetadataUnit.builder();
      for (Map.Entry<MethodHandle, Object> entry : valueToSet.entrySet()) {
        try {
          entry.getKey().invokeWithArguments(builder, entry.getValue());
        } catch (Throwable e) {
          throw new IcebergMetastoreException(
            String.format("Unable to invoke setter for [%s] using [%s]",
              TableMetadataUnit.Builder.class.getSimpleName(), entry.getKey()), e);
        }
      }
      results.add(builder.build());
    }
    return results;
  }

  public  TablesOutputDataTransformer(Map<String, MethodHandle> unitSetters);

}