Package io.trino.operator
Class SimplePagesHashStrategy
- java.lang.Object
-
- io.trino.operator.SimplePagesHashStrategy
-
- All Implemented Interfaces:
PagesHashStrategy
public class SimplePagesHashStrategy extends Object implements PagesHashStrategy
-
-
Constructor Summary
Constructors Constructor Description SimplePagesHashStrategy(List<Type> types, List<Integer> outputChannels, List<List<Block>> channels, List<Integer> hashChannels, OptionalInt precomputedHashChannel, Optional<Integer> sortChannel, BlockTypeOperators blockTypeOperators)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendTo(int blockIndex, int position, PageBuilder pageBuilder, int outputChannelOffset)Appends all values at the specified position to the page builder starting atoutputChannelOffset.intcompareSortChannelPositions(int leftBlockIndex, int leftBlockPosition, int rightBlockIndex, int rightBlockPosition)Compares sort channel (if applicable) values at the specified positions.intgetChannelCount()Gets the number of columns appended by this PagesHashStrategy.longgetSizeInBytes()Get the total of allocated sizelonghashPosition(int blockIndex, int position)Calculates the hash code the hashed columns in this PagesHashStrategy at the specified position.longhashRow(int position, Page page)Calculates the hash code atpositioninpage.booleanisPositionNull(int blockIndex, int blockPosition)Checks if any of the hashed columns is nullbooleanisSortChannelPositionNull(int blockIndex, int blockPosition)Checks if sort channel is null at the specified positionbooleanpositionEqualsPosition(int leftBlockIndex, int leftPosition, int rightBlockIndex, int rightPosition)Compares the hashed columns in this PagesHashStrategy at the specified positions.booleanpositionEqualsPositionIgnoreNulls(int leftBlockIndex, int leftPosition, int rightBlockIndex, int rightPosition)Compares the hashed columns in this PagesHashStrategy at the specified positions.booleanpositionEqualsRow(int leftBlockIndex, int leftPosition, int rightPosition, Page rightPage)Compares the hashed columns in this PagesHashStrategy to the values in the specified page.booleanpositionEqualsRowIgnoreNulls(int leftBlockIndex, int leftPosition, int rightPosition, Page rightPage)Compares the hashed columns in this PagesHashStrategy to the values in the specified page.booleanpositionNotDistinctFromPosition(int leftBlockIndex, int leftPosition, int rightBlockIndex, int rightPosition)Compares the hashed columns in this PagesHashStrategy at the specified positions.booleanpositionNotDistinctFromRow(int leftBlockIndex, int leftPosition, int rightPosition, Page rightPage)Compares the hashed columns in this PagesHashStrategy to the values in the specified page.booleanpositionNotDistinctFromRow(int leftBlockIndex, int leftPosition, int rightPosition, Page page, int[] rightChannels)Compares the hashed columns in this PagesHashStrategy to the hashed columns in the Page.booleanrowEqualsRow(int leftPosition, Page leftPage, int rightPosition, Page rightPage)Compares the values in the specified pages.booleanrowNotDistinctFromRow(int leftPosition, Page leftPage, int rightPosition, Page rightPage)Compares the values in the specified pages.
-
-
-
Method Detail
-
getChannelCount
public int getChannelCount()
Description copied from interface:PagesHashStrategyGets the number of columns appended by this PagesHashStrategy.- Specified by:
getChannelCountin interfacePagesHashStrategy
-
getSizeInBytes
public long getSizeInBytes()
Description copied from interface:PagesHashStrategyGet the total of allocated size- Specified by:
getSizeInBytesin interfacePagesHashStrategy
-
appendTo
public void appendTo(int blockIndex, int position, PageBuilder pageBuilder, int outputChannelOffset)Description copied from interface:PagesHashStrategyAppends all values at the specified position to the page builder starting atoutputChannelOffset.- Specified by:
appendToin interfacePagesHashStrategy
-
hashPosition
public long hashPosition(int blockIndex, int position)Description copied from interface:PagesHashStrategyCalculates the hash code the hashed columns in this PagesHashStrategy at the specified position.- Specified by:
hashPositionin interfacePagesHashStrategy
-
hashRow
public long hashRow(int position, Page page)Description copied from interface:PagesHashStrategyCalculates the hash code atpositioninpage. Page must have the same number of Blocks as the hashed columns and each entry is expected to be the same type.- Specified by:
hashRowin interfacePagesHashStrategy
-
rowEqualsRow
public boolean rowEqualsRow(int leftPosition, Page leftPage, int rightPosition, Page rightPage)Description copied from interface:PagesHashStrategyCompares the values in the specified pages. The values are compared positionally, soleftPageandrightPagemust have the same number of entries as the hashed columns and each entry is expected to be the same type.- Specified by:
rowEqualsRowin interfacePagesHashStrategy
-
rowNotDistinctFromRow
public boolean rowNotDistinctFromRow(int leftPosition, Page leftPage, int rightPosition, Page rightPage)Description copied from interface:PagesHashStrategyCompares the values in the specified pages. The values are compared positionally, soleftPageandrightPagemust have the same number of entries as the hashed columns and each entry is expected to be the same type. The values are compared under "not distinct from" semantics.- Specified by:
rowNotDistinctFromRowin interfacePagesHashStrategy
-
positionEqualsRow
public boolean positionEqualsRow(int leftBlockIndex, int leftPosition, int rightPosition, Page rightPage)Description copied from interface:PagesHashStrategyCompares the hashed columns in this PagesHashStrategy to the values in the specified page. The values are compared positionally, sorightPagemust have the same number of entries as the hashed columns and each entry is expected to be the same type.rightPageis used if join uses filter function and must contain all columns from probe side of join.- Specified by:
positionEqualsRowin interfacePagesHashStrategy
-
positionNotDistinctFromRow
public boolean positionNotDistinctFromRow(int leftBlockIndex, int leftPosition, int rightPosition, Page rightPage)Description copied from interface:PagesHashStrategyCompares the hashed columns in this PagesHashStrategy to the values in the specified page. The values are compared positionally, sorightPagemust have the same number of entries as the hashed columns and each entry is expected to be the same type.rightPageis used if join uses filter function and must contain all columns from probe side of join. The values are compared under "not distinct from" semantics.- Specified by:
positionNotDistinctFromRowin interfacePagesHashStrategy
-
positionEqualsRowIgnoreNulls
public boolean positionEqualsRowIgnoreNulls(int leftBlockIndex, int leftPosition, int rightPosition, Page rightPage)Description copied from interface:PagesHashStrategyCompares the hashed columns in this PagesHashStrategy to the values in the specified page. The values are compared positionally, sorightPagemust have the same number of entries as the hashed columns and each entry is expected to be the same type.rightPageis used if join uses filter function and must contain all columns from probe side of join.This method does not perform any null checks.
- Specified by:
positionEqualsRowIgnoreNullsin interfacePagesHashStrategy
-
positionNotDistinctFromRow
public boolean positionNotDistinctFromRow(int leftBlockIndex, int leftPosition, int rightPosition, Page page, int[] rightChannels)Description copied from interface:PagesHashStrategyCompares the hashed columns in this PagesHashStrategy to the hashed columns in the Page. The values are compared positionally under "not distinct from" semantics.rightChannelsmust have the same number of entries as the hashed columns and each entry is expected to be the same type.- Specified by:
positionNotDistinctFromRowin interfacePagesHashStrategy
-
positionEqualsPosition
public boolean positionEqualsPosition(int leftBlockIndex, int leftPosition, int rightBlockIndex, int rightPosition)Description copied from interface:PagesHashStrategyCompares the hashed columns in this PagesHashStrategy at the specified positions.- Specified by:
positionEqualsPositionin interfacePagesHashStrategy
-
positionNotDistinctFromPosition
public boolean positionNotDistinctFromPosition(int leftBlockIndex, int leftPosition, int rightBlockIndex, int rightPosition)Description copied from interface:PagesHashStrategyCompares the hashed columns in this PagesHashStrategy at the specified positions. The values are compared under "not distinct from" semantics.- Specified by:
positionNotDistinctFromPositionin interfacePagesHashStrategy
-
positionEqualsPositionIgnoreNulls
public boolean positionEqualsPositionIgnoreNulls(int leftBlockIndex, int leftPosition, int rightBlockIndex, int rightPosition)Description copied from interface:PagesHashStrategyCompares the hashed columns in this PagesHashStrategy at the specified positions.This method does not perform any null checks.
- Specified by:
positionEqualsPositionIgnoreNullsin interfacePagesHashStrategy
-
isPositionNull
public boolean isPositionNull(int blockIndex, int blockPosition)Description copied from interface:PagesHashStrategyChecks if any of the hashed columns is null- Specified by:
isPositionNullin interfacePagesHashStrategy
-
compareSortChannelPositions
public int compareSortChannelPositions(int leftBlockIndex, int leftBlockPosition, int rightBlockIndex, int rightBlockPosition)Description copied from interface:PagesHashStrategyCompares sort channel (if applicable) values at the specified positions.- Specified by:
compareSortChannelPositionsin interfacePagesHashStrategy
-
isSortChannelPositionNull
public boolean isSortChannelPositionNull(int blockIndex, int blockPosition)Description copied from interface:PagesHashStrategyChecks if sort channel is null at the specified position- Specified by:
isSortChannelPositionNullin interfacePagesHashStrategy
-
-