Package io.trino.plugin.hive
Class HiveUpdateProcessor
- java.lang.Object
-
- io.trino.plugin.hive.HiveUpdateProcessor
-
public class HiveUpdateProcessor extends Object
-
-
Constructor Summary
Constructors Constructor Description HiveUpdateProcessor(List<HiveColumnHandle> allDataColumns, List<HiveColumnHandle> updatedColumns)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BlockcreateMergedColumnsBlock(Page page, List<Integer> columnValueAndRowIdChannels)BlockcreateUpdateRowBlock(Page page, List<Integer> nonUpdatedChannelNumbers, OrcDeletedRows.MaskDeletedRowsFunction maskDeletedRowsFunction)Create a RowBlock containing four children: the three ACID columns - - originalTransaction, rowId, bucket - - and a RowBlock containing all the data columns not changed by the UPDATE statement.RowBlockgetAcidRowBlock(Page page, List<Integer> columnValueAndRowIdChannels)List<HiveColumnHandle>getAllDataColumns()List<HiveColumnHandle>getNonUpdatedColumns()List<HiveColumnHandle>getUpdatedColumns()static HiveColumnHandlegetUpdateRowIdColumnHandle(List<HiveColumnHandle> nonUpdatedColumnHandles)Return the column UPDATE column handle, which depends on the 3 ACID columns as well as the non-updated columns.List<Integer>makeDependencyChannelNumbers(List<HiveColumnHandle> dependencyColumns)List<Integer>makeNonUpdatedSourceChannels(List<HiveColumnHandle> dependencyColumns)List<HiveColumnHandle>mergeWithNonUpdatedColumns(List<HiveColumnHandle> updateDependencies)Merge the non-updated columns with the update dependencies, in allDataColumns order, and finally add the rowId column as the last dependency.PageremoveNonDependencyColumns(Page page, List<Integer> dependencyChannels)Project expects the page to begin with the update dependencies, followed by the "rowId" column.
-
-
-
Constructor Detail
-
HiveUpdateProcessor
public HiveUpdateProcessor(List<HiveColumnHandle> allDataColumns, List<HiveColumnHandle> updatedColumns)
-
-
Method Detail
-
getAllDataColumns
public List<HiveColumnHandle> getAllDataColumns()
-
getUpdatedColumns
public List<HiveColumnHandle> getUpdatedColumns()
-
getNonUpdatedColumns
public List<HiveColumnHandle> getNonUpdatedColumns()
-
mergeWithNonUpdatedColumns
public List<HiveColumnHandle> mergeWithNonUpdatedColumns(List<HiveColumnHandle> updateDependencies)
Merge the non-updated columns with the update dependencies, in allDataColumns order, and finally add the rowId column as the last dependency.
-
createUpdateRowBlock
public Block createUpdateRowBlock(Page page, List<Integer> nonUpdatedChannelNumbers, OrcDeletedRows.MaskDeletedRowsFunction maskDeletedRowsFunction)
Create a RowBlock containing four children: the three ACID columns - - originalTransaction, rowId, bucket - - and a RowBlock containing all the data columns not changed by the UPDATE statement.
-
removeNonDependencyColumns
public Page removeNonDependencyColumns(Page page, List<Integer> dependencyChannels)
Project expects the page to begin with the update dependencies, followed by the "rowId" column. Remove columns from the page if they are not update dependencies.
-
getUpdateRowIdColumnHandle
public static HiveColumnHandle getUpdateRowIdColumnHandle(List<HiveColumnHandle> nonUpdatedColumnHandles)
Return the column UPDATE column handle, which depends on the 3 ACID columns as well as the non-updated columns.
-
getAcidRowBlock
public RowBlock getAcidRowBlock(Page page, List<Integer> columnValueAndRowIdChannels)
-
createMergedColumnsBlock
public Block createMergedColumnsBlock(Page page, List<Integer> columnValueAndRowIdChannels)
- Parameters:
page- The first block in the page is a RowBlock, containing the three ACID columns - - originalTransaction, bucket and rowId - - plus a RowBlock containing the values of non-updated columns. The remaining blocks are the values of the updated columns, whose offsets given by columnValueAndRowIdChannels- Returns:
- The RowBlock for updated and non-updated columns
-
makeDependencyChannelNumbers
public List<Integer> makeDependencyChannelNumbers(List<HiveColumnHandle> dependencyColumns)
-
makeNonUpdatedSourceChannels
public List<Integer> makeNonUpdatedSourceChannels(List<HiveColumnHandle> dependencyColumns)
-
-