Package io.trino.operator
Class PagesIndex
- java.lang.Object
-
- io.trino.operator.PagesIndex
-
- All Implemented Interfaces:
it.unimi.dsi.fastutil.Swapper
public class PagesIndex extends Object implements it.unimi.dsi.fastutil.Swapper
PagesIndex a low-level data structure which contains the address of every value position of every channel. This data structure is not general purpose and is designed for a few specific uses:- Sort via the
sort(java.util.List<java.lang.Integer>, java.util.List<io.trino.spi.connector.SortOrder>)method - Hash build via the
createLookupSourceSupplier(io.trino.Session, java.util.List<java.lang.Integer>)method - Positional output via the
appendTo(int, int, io.trino.spi.block.BlockBuilder)method
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPagesIndex.DefaultFactorystatic interfacePagesIndex.Factorystatic classPagesIndex.TestingFactory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPage(Page page)voidappendTo(int channel, int position, BlockBuilder output)intbuildPage(int position, int[] outputChannels, PageBuilder pageBuilder)voidclear()voidcompact()PagesIndexComparatorcreateChannelComparator(int leftChannel, int rightChannel)Supplier<LookupSource>createLookupSourceSupplier(Session session, List<Integer> joinChannels)LookupSourceSuppliercreateLookupSourceSupplier(Session session, List<Integer> joinChannels, OptionalInt hashChannel, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory, Optional<Integer> sortChannel, List<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> searchFunctionFactories)LookupSourceSuppliercreateLookupSourceSupplier(Session session, List<Integer> joinChannels, OptionalInt hashChannel, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory, Optional<Integer> sortChannel, List<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> searchFunctionFactories, Optional<List<Integer>> outputChannels)PagesHashStrategycreatePagesHashStrategy(List<Integer> joinChannels, OptionalInt hashChannel)PagesHashStrategycreatePagesHashStrategy(List<Integer> joinChannels, OptionalInt hashChannel, Optional<List<Integer>> outputChannels)PagesSpatialIndexSuppliercreatePagesSpatialIndex(Session session, int geometryChannel, Optional<Integer> radiusChannel, Optional<Integer> partitionChannel, SpatialIndexBuilderOperator.SpatialPredicate spatialRelationshipTest, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory, List<Integer> outputChannels, Map<Integer,Rectangle> partitions)booleangetBoolean(int channel, int position)it.unimi.dsi.fastutil.objects.ObjectArrayList<Block>getChannel(int channel)doublegetDouble(int channel, int position)io.airlift.units.DataSizegetEstimatedSize()longgetLong(int channel, int position)ObjectgetObject(int channel, int position)Iterator<Page>getPages()intgetPositionCount()BlockgetSingleValueBlock(int channel, int position)io.airlift.slice.SlicegetSlice(int channel, int position)Iterator<Page>getSortedPages()TypegetType(int channel)List<Type>getTypes()it.unimi.dsi.fastutil.longs.LongArrayListgetValueAddresses()booleanisNull(int channel, int position)booleanpositionNotDistinctFromPosition(PagesHashStrategy partitionHashStrategy, int leftPosition, int rightPosition)booleanpositionNotDistinctFromRow(PagesHashStrategy pagesHashStrategy, int indexPosition, int rightPosition, Page rightPage)voidsort(List<Integer> sortChannels, List<SortOrder> sortOrders)voidsort(List<Integer> sortChannels, List<SortOrder> sortOrders, int startPosition, int endPosition)voidswap(int a, int b)StringtoString()
-
-
-
Method Detail
-
getPositionCount
public int getPositionCount()
-
getValueAddresses
public it.unimi.dsi.fastutil.longs.LongArrayList getValueAddresses()
-
getChannel
public it.unimi.dsi.fastutil.objects.ObjectArrayList<Block> getChannel(int channel)
-
clear
public void clear()
-
addPage
public void addPage(Page page)
-
getEstimatedSize
public io.airlift.units.DataSize getEstimatedSize()
-
compact
public void compact()
-
getType
public Type getType(int channel)
-
swap
public void swap(int a, int b)- Specified by:
swapin interfaceit.unimi.dsi.fastutil.Swapper
-
buildPage
public int buildPage(int position, int[] outputChannels, PageBuilder pageBuilder)
-
appendTo
public void appendTo(int channel, int position, BlockBuilder output)
-
isNull
public boolean isNull(int channel, int position)
-
getBoolean
public boolean getBoolean(int channel, int position)
-
getLong
public long getLong(int channel, int position)
-
getDouble
public double getDouble(int channel, int position)
-
getSlice
public io.airlift.slice.Slice getSlice(int channel, int position)
-
getObject
public Object getObject(int channel, int position)
-
getSingleValueBlock
public Block getSingleValueBlock(int channel, int position)
-
sort
public void sort(List<Integer> sortChannels, List<SortOrder> sortOrders, int startPosition, int endPosition)
-
positionNotDistinctFromPosition
public boolean positionNotDistinctFromPosition(PagesHashStrategy partitionHashStrategy, int leftPosition, int rightPosition)
-
positionNotDistinctFromRow
public boolean positionNotDistinctFromRow(PagesHashStrategy pagesHashStrategy, int indexPosition, int rightPosition, Page rightPage)
-
createLookupSourceSupplier
public Supplier<LookupSource> createLookupSourceSupplier(Session session, List<Integer> joinChannels)
-
createPagesHashStrategy
public PagesHashStrategy createPagesHashStrategy(List<Integer> joinChannels, OptionalInt hashChannel)
-
createPagesHashStrategy
public PagesHashStrategy createPagesHashStrategy(List<Integer> joinChannels, OptionalInt hashChannel, Optional<List<Integer>> outputChannels)
-
createChannelComparator
public PagesIndexComparator createChannelComparator(int leftChannel, int rightChannel)
-
createLookupSourceSupplier
public LookupSourceSupplier createLookupSourceSupplier(Session session, List<Integer> joinChannels, OptionalInt hashChannel, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory, Optional<Integer> sortChannel, List<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> searchFunctionFactories)
-
createPagesSpatialIndex
public PagesSpatialIndexSupplier createPagesSpatialIndex(Session session, int geometryChannel, Optional<Integer> radiusChannel, Optional<Integer> partitionChannel, SpatialIndexBuilderOperator.SpatialPredicate spatialRelationshipTest, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory, List<Integer> outputChannels, Map<Integer,Rectangle> partitions)
-
createLookupSourceSupplier
public LookupSourceSupplier createLookupSourceSupplier(Session session, List<Integer> joinChannels, OptionalInt hashChannel, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory, Optional<Integer> sortChannel, List<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> searchFunctionFactories, Optional<List<Integer>> outputChannels)
-
-