Package org.apache.iceberg.spark.actions
Class SparkZOrderStrategy
- java.lang.Object
-
- org.apache.iceberg.actions.BinPackStrategy
-
- org.apache.iceberg.actions.SortStrategy
-
- org.apache.iceberg.spark.actions.SparkSortStrategy
-
- org.apache.iceberg.spark.actions.SparkZOrderStrategy
-
- All Implemented Interfaces:
java.io.Serializable,RewriteStrategy
public class SparkZOrderStrategy extends SparkSortStrategy
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.iceberg.spark.actions.SparkSortStrategy
COMPRESSION_FACTOR
-
Fields inherited from class org.apache.iceberg.actions.BinPackStrategy
DELETE_FILE_THRESHOLD, DELETE_FILE_THRESHOLD_DEFAULT, MAX_FILE_SIZE_BYTES, MAX_FILE_SIZE_DEFAULT_RATIO, MIN_FILE_SIZE_BYTES, MIN_FILE_SIZE_DEFAULT_RATIO, MIN_INPUT_FILES, MIN_INPUT_FILES_DEFAULT, REWRITE_ALL, REWRITE_ALL_DEFAULT
-
-
Constructor Summary
Constructors Constructor Description SparkZOrderStrategy(Table table, org.apache.spark.sql.SparkSession spark, java.util.List<java.lang.String> zOrderColNames)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringname()Returns the name of this rewrite strategyRewriteStrategyoptions(java.util.Map<java.lang.String,java.lang.String> options)Sets options to be used with this strategyjava.util.Set<DataFile>rewriteFiles(java.util.List<FileScanTask> filesToRewrite)Method which will rewrite files based on this particular RewriteStrategy's algorithm.protected SortOrdersortOrder()protected voidvalidateOptions()java.util.Set<java.lang.String>validOptions()Returns a set of options which this rewrite strategy can use.-
Methods inherited from class org.apache.iceberg.spark.actions.SparkSortStrategy
manager, rewriteCoordinator, sizeEstimateMultiple, sortPlan, spark, table, tableCache
-
Methods inherited from class org.apache.iceberg.actions.SortStrategy
sortOrder
-
Methods inherited from class org.apache.iceberg.actions.BinPackStrategy
inputFileSize, numOutputFiles, planFileGroups, selectFilesToRewrite, splitSize, targetFileSize, writeMaxFileSize
-
-
-
-
Constructor Detail
-
SparkZOrderStrategy
public SparkZOrderStrategy(Table table, org.apache.spark.sql.SparkSession spark, java.util.List<java.lang.String> zOrderColNames)
-
-
Method Detail
-
validOptions
public java.util.Set<java.lang.String> validOptions()
Description copied from interface:RewriteStrategyReturns a set of options which this rewrite strategy can use. This is an allowed-list and any options not specified here will be rejected at runtime.- Specified by:
validOptionsin interfaceRewriteStrategy- Overrides:
validOptionsin classSparkSortStrategy
-
options
public RewriteStrategy options(java.util.Map<java.lang.String,java.lang.String> options)
Description copied from interface:RewriteStrategySets options to be used with this strategy- Specified by:
optionsin interfaceRewriteStrategy- Overrides:
optionsin classSparkSortStrategy
-
name
public java.lang.String name()
Description copied from interface:RewriteStrategyReturns the name of this rewrite strategy- Specified by:
namein interfaceRewriteStrategy- Overrides:
namein classSortStrategy
-
validateOptions
protected void validateOptions()
- Overrides:
validateOptionsin classSortStrategy
-
rewriteFiles
public java.util.Set<DataFile> rewriteFiles(java.util.List<FileScanTask> filesToRewrite)
Description copied from interface:RewriteStrategyMethod which will rewrite files based on this particular RewriteStrategy's algorithm. This will most likely be Action framework specific (Spark/Presto/Flink ....).- Specified by:
rewriteFilesin interfaceRewriteStrategy- Overrides:
rewriteFilesin classSparkSortStrategy- Parameters:
filesToRewrite- a group of files to be rewritten together- Returns:
- a set of newly written files
-
sortOrder
protected SortOrder sortOrder()
- Overrides:
sortOrderin classSortStrategy
-
-