Class ChangeOnlyUpdatedColumnsMergeProcessor

java.lang.Object
io.trino.operator.ChangeOnlyUpdatedColumnsMergeProcessor
All Implemented Interfaces:
MergeRowChangeProcessor

public class ChangeOnlyUpdatedColumnsMergeProcessor extends Object implements MergeRowChangeProcessor
The transformPage() method in this class does two things:
  • Transform the input page into an "update" page format
  • Removes all rows whose operation number is DEFAULT_CASE_OPERATION_NUMBER
  • Constructor Details

    • ChangeOnlyUpdatedColumnsMergeProcessor

      public ChangeOnlyUpdatedColumnsMergeProcessor(int rowIdChannel, int mergeRowChannel, List<Integer> dataColumnChannels, List<Integer> redistributionColumnChannels)
  • Method Details

    • transformPage

      public Page transformPage(Page inputPage)
      Description copied from interface: MergeRowChangeProcessor
      Transform a page generated by an SQL MERGE operation into page of data columns and operations. The SQL MERGE input page consists of the following:
      • The write redistribution columns, if any
      • For partitioned or bucketed tables, a hash value column
      • The rowId column for the row from the target table if matched, or null if not matched
      • The merge case row block
      The output page consists of the following:
      • All data columns, in table column order
      • The operation block
      • The rowId block
      • The last column in the resulting page is 1 if the row is an insert derived from an update, and zero otherwise.

      The DeleteAndInsertMergeProcessor implementation will transform each UPDATE row into multiple rows: an INSERT row and a DELETE row.

      Specified by:
      transformPage in interface MergeRowChangeProcessor