Enum Class DeleteGranularity

java.lang.Object
java.lang.Enum<DeleteGranularity>
org.apache.iceberg.deletes.DeleteGranularity
All Implemented Interfaces:
Serializable, Comparable<DeleteGranularity>, Constable

public enum DeleteGranularity extends Enum<DeleteGranularity>
An enum that represents the granularity of deletes.

Under partition granularity, delete writers are directed to group deletes for different data files into one delete file. This strategy tends to reduce the total number of delete files in the table. However, a scan for a single data file will require reading delete information for multiple data files even if those other files are not required for the scan. All irrelevant deletes will be discarded by readers but reading this extra information will cause overhead. The overhead can potentially be mitigated via delete file caching.

Under file granularity, delete writers always organize deletes by their target data file, creating separate delete files for each referenced data file. This strategy ensures the job planning does not assign irrelevant deletes to data files and readers only load necessary delete information. However, it also increases the total number of delete files in the table and may require a more aggressive approach for delete file compaction.

Currently, this configuration is only applicable to position deletes.

Each granularity has its own benefits and drawbacks and should be picked based on a use case. Regular delete compaction is still required regardless of which granularity is chosen. It is also possible to use one granularity for ingestion and another one for table maintenance.

  • Enum Constant Details

  • Method Details

    • values

      public static DeleteGranularity[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DeleteGranularity valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • toString

      public String toString()
      Overrides:
      toString in class Enum<DeleteGranularity>
    • fromString

      public static DeleteGranularity fromString(String valueAsString)