Compare Operators and Comparators

This topic describesthe compare operators and comparators for comparison filters.

The comparison filters DependentColumnFilter, FamilyFilter, QualifierFilter, RowFilter, and ValueFilter use the following syntax:

filter(<compareOperator>, <comparatorType:Value>)

Compare Operators

The following compare operators are supported: <,<=, =, !=, >, >=

Comparators

There are four comparators:

Comparator Description
BinaryComparator

This comparator lexicographically compares against the specified byte array .

Values are byte arrays.

For example, binary:abc matches values that are lexicographically greater than "abc”.

BinaryPrefixComparator

This comparator lexicographically compares against a specified byte array. It only compares up to the length of this byte array.

Values are byte arrays.

For example, binaryprefix:abc matches values in which the first 3 characters are lexicographically equal to "abc"

RegexStringComparator

This comparator compares against the specified byte array using the given regular expression.

You can use only the = and != compare operators with this comparator.

Values are regular expressions.

For example, regexstring:ab*yz matches values that begin with "ab" and end with "yz”.

SubStringComparator

This comparator tests whether the given substring appears in a specified byte array. The comparison is case insensitive.

You can use only the = and != compare operators with this comparator.

Values are strings.

For example, substring:abc123 matches values that contains the substring "abc123”.