Skip to main content
Version: Java (Groovy)

equals

The equals (=) match filter returns rows that are an exact match to the specified value.

Syntax

columnName = value
columnName == value
  • columnName - the column the filter will search for the matching value.
  • value - the value to match on.

Examples

The following example returns rows where Color is blue.

source = newTable(
stringCol("Letter", "A", "C", "F", "B", "E", "D", "A"),
intCol("Number", NULL_INT, 2, 1, NULL_INT, 4, 5, 3),
stringCol("Color", "red", "blue", "orange", "purple", "yellow", "pink", "blue"),
intCol("Code", 12, 13, 11, NULL_INT, 16, 14, NULL_INT),
)

result = source.where("Color = `blue`")

The following example returns rows where Color is blue and Code is 14.

source = newTable(
stringCol("Letter", "A", "C", "F", "B", "E", "D", "A"),
intCol("Number", NULL_INT, 2, 1, NULL_INT, 4, 5, 3),
stringCol("Color", "red", "blue", "orange", "purple", "yellow", "pink", "blue"),
intCol("Code", 12, 14, 11, NULL_INT, 16, 14, NULL_INT),
)

result = source.where("Color = `blue`", "Code = 14" )

The following example returns rows where Color is blue or Code is 14.

import io.deephaven.api.filter.FilterOr
import io.deephaven.api.filter.Filter

source = newTable(
stringCol("Letter", "A", "C", "F", "B", "E", "D", "A"),
intCol("Number", NULL_INT, 2, 1, NULL_INT, 4, 5, 3),
stringCol("Color", "red", "blue", "orange", "purple", "yellow", "pink", "blue"),
intCol("Code", 12, 14, 11, NULL_INT, 16, 14, NULL_INT),
)

result = source.where(FilterOr.of(Filter.from("Color = `blue`", "Code = 14")))