Class ColumnComparisonFilter

  • All Implemented Interfaces:
    Filter

    public class ColumnComparisonFilter
    extends Object
    implements Filter
    Compares values between columns, first converting them all to strings. This filter behaves like "not distinct from", e.g. given columns x and y, the SQL equivalent would be "x is not distinct from y" (and so ignores includeUnknown).
    • Constructor Detail

      • ColumnComparisonFilter

        public ColumnComparisonFilter​(List<DimensionSpec> dimensions)
    • Method Detail

      • makeMatcher

        public ValueMatcher makeMatcher​(ColumnSelectorFactory factory)
        Description copied from interface: Filter
        Get a ValueMatcher that applies this filter to row values.
        Specified by:
        makeMatcher in interface Filter
        Parameters:
        factory - Object used to create ValueMatchers
        Returns:
        ValueMatcher that applies this filter to row values.
      • overlap

        public static boolean overlap​(@Nullable
                                      String[] as,
                                      @Nullable
                                      String[] bs)
        overlap returns true when: as and bs have one or more elements in common, as and bs are both null, or as and bs are both empty.
      • supportsSelectivityEstimation

        public boolean supportsSelectivityEstimation​(ColumnSelector columnSelector,
                                                     ColumnIndexSelector indexSelector)
        Description copied from interface: Filter
        Indicates whether this filter supports selectivity estimation. A filter supports selectivity estimation if it supports bitmap index and the dimension which the filter evaluates does not have multi values.
        Specified by:
        supportsSelectivityEstimation in interface Filter
        Parameters:
        columnSelector - Object to check the dimension has multi values.
        indexSelector - Object used to retrieve bitmap indexes
        Returns:
        true if this Filter supports selectivity estimation, false otherwise.
      • estimateSelectivity

        public double estimateSelectivity​(ColumnIndexSelector indexSelector)
        Description copied from interface: Filter
        Estimate selectivity of this filter. This method can be used for cost-based query planning like in AutoStrategy. To avoid significant performance degradation for calculating the exact cost, implementation of this method targets to achieve rapid selectivity estimation with reasonable sacrifice of the accuracy. As a result, the estimated selectivity might be different from the exact value.
        Specified by:
        estimateSelectivity in interface Filter
        Parameters:
        indexSelector - Object used to retrieve indexes
        Returns:
        an estimated selectivity ranging from 0 (filter selects no rows) to 1 (filter selects all rows).
        See Also:
        Filter.getBitmapColumnIndex(ColumnIndexSelector)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object