Class ValueMatchers

    • Method Detail

      • allTrue

        public static ValueMatcher allTrue()
        Matcher for constant 'true' condition, where all rows should always match
      • allFalse

        public static ValueMatcher allFalse()
        Matcher for constant 'false' condition, where rows will never be matched
      • allUnknown

        public static ValueMatcher allUnknown()
        Matcher for constant 'unknown' condition, such as a column of all null values, where rows will never match unless includeUnknown is set to true on the match function.
      • makeStringValueMatcher

        public static ValueMatcher makeStringValueMatcher​(DimensionSelector selector,
                                                          String value,
                                                          boolean hasMultipleValues)
        Creates a constant-based ValueMatcher for a string-typed selector.
        Parameters:
        selector - column selector
        value - value to match
        hasMultipleValues - whether the column selector *might* have multiple values
      • makeStringValueMatcher

        public static ValueMatcher makeStringValueMatcher​(DimensionSelector selector,
                                                          DruidPredicateFactory predicateFactory,
                                                          boolean hasMultipleValues)
        Creates a predicate-based ValueMatcher for a string-typed selector.
        Parameters:
        selector - column selector
        predicateFactory - predicate to match
        hasMultipleValues - whether the column selector *might* have multiple values
      • makeAlwaysFalseDimensionMatcher

        public static ValueMatcher makeAlwaysFalseDimensionMatcher​(DimensionSelector selector,
                                                                   boolean multiValue)
        Create a matcher that should always return false, except when includeUnknown is set, in which case only null values will be matched. This is typically used when the filter should never match any actual values, but still needs to be able to report 'unknown' matches.
      • makeAlwaysFalseNumericMatcher

        public static ValueMatcher makeAlwaysFalseNumericMatcher​(BaseNullableColumnValueSelector selector)
        Create a matcher that should always return false, except when includeUnknown is set, in which case only null values will be matched. This is typically used when the filter should never match any actual values, but still needs to be able to report 'unknown' matches.
      • makeAlwaysFalseObjectMatcher

        public static ValueMatcher makeAlwaysFalseObjectMatcher​(BaseObjectColumnValueSelector<?> selector)
        Create a matcher that should always return false, except when includeUnknown is set, in which case only null values will be matched. This is typically used when the filter should never match any actual values, but still needs to be able to report 'unknown' matches.
      • toConstantMatcherTypeIfPossible

        @Nullable
        public static ConstantMatcherType toConstantMatcherTypeIfPossible​(DimensionDictionarySelector selector,
                                                                          boolean hasMultipleValues,
                                                                          com.google.common.base.Predicate<String> predicate)
        If applying predicate to selector would always return a constant, returns that constant. Otherwise, returns null. This method would have been private, except it's also used by SingleValueStringVectorValueMatcher.
        Parameters:
        selector - string selector
        hasMultipleValues - whether the selector *might* have multiple values
        predicate - predicate to apply