Class TableChangesUtils

Object
io.delta.kernel.internal.TableChangesUtils

public class TableChangesUtils extends Object
Utility class for table changes operations.
  • Field Details

    • VERSION_COLUMN_NAME

      public static final String VERSION_COLUMN_NAME
      Column name for the version metadata column added to getActions results.
      See Also:
    • TIMESTAMP_COLUMN_NAME

      public static final String TIMESTAMP_COLUMN_NAME
      Column name for the timestamp metadata column added to getActions results.
      See Also:
  • Method Details

    • addVersionAndTimestampColumns

      public static ColumnarBatch addVersionAndTimestampColumns(Engine engine, ColumnarBatch batch, long version, long timestamp)
      Adds version and timestamp columns to a columnar batch.

      The version and timestamp columns are added as the first two columns in the batch.

      Parameters:
      engine - the engine for expression evaluation
      batch - the original batch
      version - the version value to add
      timestamp - the timestamp value to add
      Returns:
      a new batch with version and timestamp columns prepended
    • flattenCommitsAndAddMetadata

      public static CloseableIterator<ColumnarBatch> flattenCommitsAndAddMetadata(Engine engine, CloseableIterator<CommitActions> commits)
      Flattens an iterator of CommitActions into an iterator of ColumnarBatch, adding version and timestamp columns to each batch.
      Parameters:
      engine - the engine for expression evaluation
      commits - the iterator of CommitActions to flatten
      Returns:
      an iterator of ColumnarBatch with version and timestamp columns added