Package io.trino.operator
Class PagesIndex
java.lang.Object
io.trino.operator.PagesIndex
- All Implemented Interfaces:
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 ClassesModifier and TypeClassDescriptionstatic classstatic interfacestatic class -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidappendTo(int channel, int position, BlockBuilder output) voidclear()voidcompact()createChannelComparator(int leftChannel, int rightChannel) createLookupSourceSupplier(Session session, List<Integer> joinChannels) createLookupSourceSupplier(Session session, List<Integer> joinChannels, OptionalInt hashChannel, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory, Optional<Integer> sortChannel, List<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> searchFunctionFactories) createLookupSourceSupplier(Session session, List<Integer> joinChannels, OptionalInt hashChannel, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory, Optional<Integer> sortChannel, List<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> searchFunctionFactories, Optional<List<Integer>> outputChannels, HashArraySizeSupplier hashArraySizeSupplier) createPagesHashStrategy(List<Integer> joinChannels, OptionalInt hashChannel) createPagesSpatialIndex(Session session, int geometryChannel, Optional<Integer> radiusChannel, OptionalDouble constantRadius, 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) longgetEstimatedMemoryRequiredToCreateLookupSource(HashArraySizeSupplier hashArraySizeSupplier, Optional<Integer> sortChannel, List<Integer> joinChannels) io.airlift.units.DataSizelonggetLong(int channel, int position) getObject(int channel, int position) getPages()intgetRawBlock(int channel, int position) intgetRawBlockPosition(int position) getSingleValueBlock(int channel, int position) io.airlift.slice.SlicegetSlice(int channel, int position) getSortedPages(int start, int end) Get sorted pages from the specified section of the PagesIndex.getType(int channel) getTypes()it.unimi.dsi.fastutil.longs.LongArrayListbooleanisNull(int channel, int position) booleanpositionNotDistinctFromPosition(PagesHashStrategy partitionHashStrategy, int leftPosition, int rightPosition) booleanpositionNotDistinctFromRow(PagesHashStrategy pagesHashStrategy, int indexPosition, int rightPosition, Page rightPage) voidvoidvoidswap(int a, int b) toString()
-
Method Details
-
getTypes
-
getPositionCount
public int getPositionCount() -
getValueAddresses
public it.unimi.dsi.fastutil.longs.LongArrayList getValueAddresses() -
getChannel
-
clear
public void clear() -
addPage
-
getEstimatedSize
public io.airlift.units.DataSize getEstimatedSize() -
compact
public void compact() -
getType
-
swap
public void swap(int a, int b) - Specified by:
swapin interfaceit.unimi.dsi.fastutil.Swapper
-
appendTo
-
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
-
getSingleValueBlock
-
getRawBlock
-
getRawBlockPosition
public int getRawBlockPosition(int position) -
sort
-
sort
-
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) -
createChannelComparator
-
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, OptionalDouble constantRadius, 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, HashArraySizeSupplier hashArraySizeSupplier) -
toString
-
getPages
-
getSortedPages
-
getSortedPages
Get sorted pages from the specified section of the PagesIndex.- Parameters:
start- start position of the section, inclusiveend- end position of the section, exclusive- Returns:
- iterator of pages
-
getEstimatedMemoryRequiredToCreateLookupSource
public long getEstimatedMemoryRequiredToCreateLookupSource(HashArraySizeSupplier hashArraySizeSupplier, Optional<Integer> sortChannel, List<Integer> joinChannels)
-