Enum DeleteGranularity
- java.lang.Object
-
- java.lang.Enum<DeleteGranularity>
-
- org.apache.iceberg.deletes.DeleteGranularity
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<DeleteGranularity>
public enum DeleteGranularity extends java.lang.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.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DeleteGranularity
fromString(java.lang.String valueAsString)
java.lang.String
toString()
static DeleteGranularity
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static DeleteGranularity[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
FILE
public static final DeleteGranularity FILE
-
PARTITION
public static final DeleteGranularity PARTITION
-
-
Method Detail
-
values
public static DeleteGranularity[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DeleteGranularity c : DeleteGranularity.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DeleteGranularity valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<DeleteGranularity>
-
fromString
public static DeleteGranularity fromString(java.lang.String valueAsString)
-
-