Skip to content

Commit

Permalink
Make DiscreteSet in Domain public
Browse files Browse the repository at this point in the history
Current SPI exposes discrete sets only through
TupleDomain#extractDiscreteValues which carries
the extra overhead of wrapper object NullableValue
and an additional iteration over the values.
  • Loading branch information
raunaqmorarka authored and sopel39 committed Jul 21, 2021
1 parent 5d1523f commit 8867aa2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/trino-spi/src/main/java/io/trino/spi/predicate/Domain.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ public boolean includesNullableValue(Object value)
return value == null ? nullAllowed : values.containsValue(value);
}

boolean isNullableDiscreteSet()
public boolean isNullableDiscreteSet()
{
return values.isNone() ? nullAllowed : values.isDiscreteSet();
}

DiscreteSet getNullableDiscreteSet()
public DiscreteSet getNullableDiscreteSet()
{
if (!isNullableDiscreteSet()) {
throw new IllegalStateException("Domain is not a nullable discrete set");
Expand Down Expand Up @@ -330,7 +330,7 @@ public String toString(ConnectorSession session, int limit)
return "[ " + (nullAllowed ? "NULL, " : "") + values.toString(session, limit) + " ]";
}

static class DiscreteSet
public static class DiscreteSet
{
private final List<Object> nonNullValues;
private final boolean containsNull;
Expand All @@ -344,12 +344,12 @@ static class DiscreteSet
}
}

List<Object> getNonNullValues()
public List<Object> getNonNullValues()
{
return nonNullValues;
}

boolean containsNull()
public boolean containsNull()
{
return containsNull;
}
Expand Down

0 comments on commit 8867aa2

Please sign in to comment.