Package org.apache.iceberg.spark
Class SparkWriteConf
- java.lang.Object
-
- org.apache.iceberg.spark.SparkWriteConf
-
public class SparkWriteConf extends java.lang.Object
A class for common Iceberg configs for Spark writes.If a config is set at multiple levels, the following order of precedence is used (top to bottom):
- Write options
- Session configuration
- Table metadata
Note this class is NOT meant to be serialized and sent to executors.
-
-
Constructor Summary
Constructors Constructor Description SparkWriteConf(org.apache.spark.sql.SparkSession spark, Table table, java.util.Map<java.lang.String,java.lang.String> writeOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkNullability()
boolean
checkOrdering()
DistributionMode
copyOnWriteDeleteDistributionMode()
DistributionMode
copyOnWriteMergeDistributionMode()
DistributionMode
copyOnWriteUpdateDistributionMode()
FileFormat
dataFileFormat()
FileFormat
deleteFileFormat()
DistributionMode
distributionMode()
java.util.Map<java.lang.String,java.lang.String>
extraSnapshotMetadata()
boolean
fanoutWriterEnabled()
boolean
handleTimestampWithoutZone()
Enables writing a timestamp with time zone as a timestamp without time zone.java.lang.String
overwriteMode()
DistributionMode
positionDeleteDistributionMode()
java.lang.String
rewrittenFileSetId()
long
targetDataFileSize()
long
targetDeleteFileSize()
boolean
useTableDistributionAndOrdering()
boolean
wapEnabled()
java.lang.String
wapId()
-
-
-
Constructor Detail
-
SparkWriteConf
public SparkWriteConf(org.apache.spark.sql.SparkSession spark, Table table, java.util.Map<java.lang.String,java.lang.String> writeOptions)
-
-
Method Detail
-
checkNullability
public boolean checkNullability()
-
checkOrdering
public boolean checkOrdering()
-
handleTimestampWithoutZone
public boolean handleTimestampWithoutZone()
Enables writing a timestamp with time zone as a timestamp without time zone.Generally, this is not safe as a timestamp without time zone is supposed to represent the wall-clock time, i.e. no matter the reader/writer timezone 3PM should always be read as 3PM, but a timestamp with time zone represents instant semantics, i.e. the timestamp is adjusted so that the corresponding time in the reader timezone is displayed.
When set to false (default), an exception must be thrown if the table contains a timestamp without time zone.
- Returns:
- boolean indicating if writing timestamps without timezone is allowed
-
overwriteMode
public java.lang.String overwriteMode()
-
wapEnabled
public boolean wapEnabled()
-
wapId
public java.lang.String wapId()
-
dataFileFormat
public FileFormat dataFileFormat()
-
targetDataFileSize
public long targetDataFileSize()
-
fanoutWriterEnabled
public boolean fanoutWriterEnabled()
-
deleteFileFormat
public FileFormat deleteFileFormat()
-
targetDeleteFileSize
public long targetDeleteFileSize()
-
extraSnapshotMetadata
public java.util.Map<java.lang.String,java.lang.String> extraSnapshotMetadata()
-
rewrittenFileSetId
public java.lang.String rewrittenFileSetId()
-
distributionMode
public DistributionMode distributionMode()
-
copyOnWriteDeleteDistributionMode
public DistributionMode copyOnWriteDeleteDistributionMode()
-
copyOnWriteUpdateDistributionMode
public DistributionMode copyOnWriteUpdateDistributionMode()
-
copyOnWriteMergeDistributionMode
public DistributionMode copyOnWriteMergeDistributionMode()
-
positionDeleteDistributionMode
public DistributionMode positionDeleteDistributionMode()
-
useTableDistributionAndOrdering
public boolean useTableDistributionAndOrdering()
-
-