Class HashJoinSegmentStorageAdapter

    • Method Detail

      • getMinValue

        @Nullable
        public Comparable getMinValue​(String column)
        Description copied from interface: StorageAdapter
        Returns the minimum value of the provided column, if known through an index, dictionary, or cache. Returns null if not known. Does not scan the column to find the minimum value.
        Specified by:
        getMinValue in interface StorageAdapter
      • getMaxValue

        @Nullable
        public Comparable getMaxValue​(String column)
        Description copied from interface: StorageAdapter
        Returns the minimum value of the provided column, if known through an index, dictionary, or cache. Returns null if not known. Does not scan the column to find the maximum value.
        Specified by:
        getMaxValue in interface StorageAdapter
      • getColumnCapabilities

        @Nullable
        public ColumnCapabilities getColumnCapabilities​(String column)
        Description copied from interface: StorageAdapter
        Returns capabilities of a particular column, if known. May be null if the column doesn't exist, or if the column does exist but the capabilities are unknown. The latter is possible with dynamically discovered columns. Note that StorageAdapters are representations of "real" segments, so they are not aware of any virtual columns that may be involved in a query. In general, query engines should instead use the method ColumnSelectorFactory.getColumnCapabilities(String), which returns capabilities for virtual columns as well.
        Specified by:
        getColumnCapabilities in interface ColumnInspector
        Specified by:
        getColumnCapabilities in interface StorageAdapter
        Parameters:
        column - column name
        Returns:
        capabilities, or null
      • hasBuiltInFilters

        public boolean hasBuiltInFilters()
        Description copied from interface: StorageAdapter
        Returns true if this storage adapter can filter some rows out. The actual column cardinality can be lower than what StorageAdapter.getDimensionCardinality(java.lang.String) returns if this returns true. Dimension selectors for such storage adapter can return non-contiguous dictionary IDs because the dictionary IDs in filtered rows will not be returned. Note that the number of rows accessible via this storage adapter will not necessarily decrease because of the built-in filters. For inner joins, for example, the number of joined rows can be larger than the number of rows in the base adapter even though this method returns true.
        Specified by:
        hasBuiltInFilters in interface StorageAdapter
      • canVectorize

        public boolean canVectorize​(@Nullable
                                    Filter filter,
                                    VirtualColumns virtualColumns,
                                    boolean descending)
        Description copied from interface: CursorFactory
        Returns true if the provided combination of parameters can be handled by "makeVectorCursor". Query engines should use this before running in vectorized mode, and be prepared to fall back to non-vectorized mode if this method returns false.
        Specified by:
        canVectorize in interface CursorFactory
      • makeVectorCursor

        @Nullable
        public VectorCursor makeVectorCursor​(@Nullable
                                             Filter filter,
                                             org.joda.time.Interval interval,
                                             VirtualColumns virtualColumns,
                                             boolean descending,
                                             int vectorSize,
                                             @Nullable
                                             QueryMetrics<?> queryMetrics)
        Description copied from interface: CursorFactory
        Creates a VectorCursor. Unlike the Cursor returned by "makeCursor", there is just one of these. Hence, this method does not take a "granularity" parameter. Before calling this method, check "canVectorize" to see if the call you are about to make will throw an error or not. Returns null if there is no data to walk over (for example, if the "interval" does not overlap the data interval of this segment).
        Specified by:
        makeVectorCursor in interface CursorFactory
      • isBaseColumn

        public boolean isBaseColumn​(String column)
        Returns whether "column" will be selected from "baseAdapter". This is true if it is not shadowed by any joinables (i.e. if it does not start with any of their prefixes).
      • determineBaseColumnsWithPreAndPostJoinVirtualColumns

        public Set<String> determineBaseColumnsWithPreAndPostJoinVirtualColumns​(VirtualColumns virtualColumns,
                                                                                @Nullable
                                                                                List<VirtualColumn> preJoinVirtualColumns,
                                                                                @Nullable
                                                                                List<VirtualColumn> postJoinVirtualColumns)
        Return a String set containing the name of columns that belong to the base table (including any pre-join virtual columns as well). Additionally, if the preJoinVirtualColumns and/or postJoinVirtualColumns arguments are provided, this method will add each VirtualColumn in the provided virtualColumns to either preJoinVirtualColumns or postJoinVirtualColumns based on whether the virtual column is pre-join or post-join.
        Parameters:
        virtualColumns - List of virtual columns from the query
        preJoinVirtualColumns - If provided, virtual columns determined to be pre-join will be added to this list
        postJoinVirtualColumns - If provided, virtual columns determined to be post-join will be added to this list
        Returns:
        The set of base column names, including any pre-join virtual columns.