Class Domain

java.lang.Object
io.trino.spi.predicate.Domain

public final class Domain extends Object
Defines the possible values of a single variable in terms of its valid scalar values and nullability.

For example:

  • Domain.none() => no scalar values allowed, NULL not allowed
  • Domain.all() => all scalar values allowed, NULL allowed
  • Domain.onlyNull() => no scalar values allowed, NULL allowed
  • Domain.notNull() => all scalar values allowed, NULL not allowed

  • Field Details

    • DEFAULT_COMPACTION_THRESHOLD

      public static final int DEFAULT_COMPACTION_THRESHOLD
      See Also:
  • Method Details

    • create

      public static Domain create(ValueSet values, boolean nullAllowed)
    • none

      public static Domain none(Type type)
    • all

      public static Domain all(Type type)
    • onlyNull

      public static Domain onlyNull(Type type)
    • notNull

      public static Domain notNull(Type type)
    • singleValue

      public static Domain singleValue(Type type, Object value)
    • singleValue

      public static Domain singleValue(Type type, Object value, boolean nullAllowed)
    • multipleValues

      public static Domain multipleValues(Type type, List<?> values)
    • multipleValues

      public static Domain multipleValues(Type type, List<?> values, boolean nullAllowed)
    • getType

      public Type getType()
    • getValues

      public ValueSet getValues()
    • isNullAllowed

      public boolean isNullAllowed()
    • isNone

      public boolean isNone()
    • isAll

      public boolean isAll()
    • isSingleValue

      public boolean isSingleValue()
    • isNullableSingleValue

      public boolean isNullableSingleValue()
    • isOnlyNull

      public boolean isOnlyNull()
    • getSingleValue

      public Object getSingleValue()
    • getNullableSingleValue

      public Object getNullableSingleValue()
    • includesNullableValue

      public boolean includesNullableValue(Object value)
    • isNullableDiscreteSet

      public boolean isNullableDiscreteSet()
    • getNullableDiscreteSet

      public Domain.DiscreteSet getNullableDiscreteSet()
    • overlaps

      public boolean overlaps(Domain other)
    • contains

      public boolean contains(Domain other)
    • intersect

      public Domain intersect(Domain other)
    • union

      public Domain union(Domain other)
    • union

      public static Domain union(List<Domain> domains)
    • complement

      public Domain complement()
    • subtract

      public Domain subtract(Domain other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • simplify

      public Domain simplify()
      Reduces the number of discrete components in the Domain if there are too many.
    • simplify

      public Domain simplify(int threshold)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(ConnectorSession session)
    • toString

      public String toString(ConnectorSession session, int limit)
    • getRetainedSizeInBytes

      public long getRetainedSizeInBytes()