Skip to content

Commit

Permalink
Explicitly set operationId when creating OutputFileFactory (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
ismailsimsek authored Sep 8, 2024
1 parent 836f319 commit b246015
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
import org.apache.iceberg.data.GenericAppenderFactory;
import org.apache.iceberg.exceptions.NoSuchTableException;
import org.apache.iceberg.io.OutputFileFactory;
import org.apache.iceberg.relocated.com.google.common.collect.Maps;
import org.apache.iceberg.relocated.com.google.common.collect.Sets;
import org.apache.iceberg.types.TypeUtil;
import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.config.ConfigProvider;
import org.eclipse.microprofile.config.ConfigValue;
Expand All @@ -35,9 +32,17 @@
import java.time.Instant;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;

import static org.apache.iceberg.TableProperties.DEFAULT_FILE_FORMAT;
import static org.apache.iceberg.TableProperties.DEFAULT_FILE_FORMAT_DEFAULT;
import static org.apache.iceberg.TableProperties.FORMAT_VERSION;

import static org.apache.iceberg.TableProperties.*;

/**
* @author Ismail Simsek
Expand Down Expand Up @@ -176,7 +181,10 @@ public static GenericAppenderFactory getTableAppender(Table icebergTable) {
public static OutputFileFactory getTableOutputFileFactory(Table icebergTable, FileFormat format) {
return OutputFileFactory.builderFor(icebergTable,
IcebergUtil.partitionId(), 1L)
.defaultSpec(icebergTable.spec()).format(format).build();
.defaultSpec(icebergTable.spec())
.operationId(UUID.randomUUID().toString())
.format(format)
.build();
}

public static int partitionId() {
Expand Down

0 comments on commit b246015

Please sign in to comment.