Class DataWriteContextImpl

Object
io.delta.kernel.internal.DataWriteContextImpl
All Implemented Interfaces:
DataWriteContext

public class DataWriteContextImpl extends Object implements 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 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 directory
      partitionValues - 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

      public String getTargetDirectory()
      Returns the target directory where the data should be written.
      Specified by:
      getTargetDirectory in interface DataWriteContext
      Returns:
      fully qualified path of the target directory
    • getPartitionValues

      public Map<String,Literal> 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

      public List<Column> getStatisticsColumns()
      Returns the list of Column that the connector can optionally collect statistics. Each Column 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 Columns. When stats are present in the written Delta log, they can be used to optimize query performance.

      Specified by:
      getStatisticsColumns in interface DataWriteContext
      Returns:
      schema of the statistics