Package io.delta.kernel.internal
Class DataWriteContextImpl
Object
io.delta.kernel.internal.DataWriteContextImpl
- All Implemented Interfaces:
DataWriteContext
Implements the
DataWriteContext
interface. In addition to the data needed for the
interface, it also contains the partition values of the targeted partition. In case of
un-partitioned tables, the partition values will be empty.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the partition values for the data to be written.Returns the list ofColumn
that the connector can optionally collect statistics.Returns the target directory where the data should be written.
-
Constructor Details
-
DataWriteContextImpl
public DataWriteContextImpl(String targetDirectory, Map<String, Literal> partitionValues, List<Column> statsColumns) Creates a new instance of WriteContext.- Parameters:
targetDirectory
- fully qualified path of the target directorypartitionValues
- partition values for the data to be written. If the table is un-partitioned, this should be an empty map.statsColumns
- Set of columns that need statistics for the data to be written. The column can be a top-level column or a nested column. E.g. "a.b.c" is a nested column. "d" is a top-level column.
-
-
Method Details
-
getTargetDirectory
Returns the target directory where the data should be written.- Specified by:
getTargetDirectory
in interfaceDataWriteContext
- Returns:
- fully qualified path of the target directory
-
getPartitionValues
Returns the partition values for the data to be written. If the table is un-partitioned, this should be an empty map.- Returns:
- partition values
-
getStatisticsColumns
Returns the list ofColumn
that the connector can optionally collect statistics. EachColumn
is a reference to a top-level or nested column in the table.Statistics collections can be skipped or collected for a partial list of the returned
Column
s. When stats are present in the written Delta log, they can be used to optimize query performance.- Specified by:
getStatisticsColumns
in interfaceDataWriteContext
- Returns:
- schema of the statistics
-