prestodb/presto · error · IllegalArgumentException
columns is empty
Error message
columns is empty
What it means
DiscretePredicates represents per-split tuple-domain predicates over a set of columns. The constructor requires a non-empty column list because predicates are keyed by columns; an empty column list is rejected with this IllegalArgumentException.
Source
Thrown at presto-spi/src/main/java/com/facebook/presto/spi/DiscretePredicates.java:33
import com.facebook.presto.common.predicate.TupleDomain;
import java.util.ArrayList;
import java.util.List;
import static java.util.Collections.unmodifiableList;
import static java.util.Objects.requireNonNull;
public final class DiscretePredicates
{
private final List<ColumnHandle> columns;
private final Iterable<TupleDomain<ColumnHandle>> predicates;
public DiscretePredicates(List<ColumnHandle> columns, Iterable<TupleDomain<ColumnHandle>> predicates)
{
requireNonNull(columns, "columns is null");
if (columns.isEmpty()) {
throw new IllegalArgumentException("columns is empty");
}
this.columns = unmodifiableList(new ArrayList<>(columns));
// do not copy predicates because it may be lazy
this.predicates = requireNonNull(predicates, "predicates is null");
}
public List<ColumnHandle> getColumns()
{
return columns;
}
public Iterable<TupleDomain<ColumnHandle>> getPredicates()
{
return predicates;
}
}
View on GitHub (pinned to 55bb57d202)
Solutions
- Ensure the columns list contains at least one ColumnHandle before constructing
- When no columns exist, pass TupleDomain.all() for the split instead of DiscretePredicates
- Fix the column-set computation that produced an empty list
Example fix
// before
new DiscretePredicates(ImmutableList.of(), predicates);
// after
if (!columns.isEmpty()) {
new DiscretePredicates(columns, predicates);
} Defensive patterns
Strategy: validation
Validate before calling
if (columns == null || columns.isEmpty()) { return null; // or use TupleDomain.all() instead of DiscretePredicates } Try / catch
try { new DiscretePredicates(columns, predicates); } catch (IllegalArgumentException e) { return null; // degrade to no discrete predicates } Prevention
- Build the columns list from non-optional projected handles and assert non-empty
- Skip DiscretePredicates entirely when no predicate columns exist
- Unit-test connector metadata paths that construct discrete predicates
When it happens
Trigger: Constructing new DiscretePredicates(Collections.emptyList(), predicates) or passing a column list that ended up empty after filtering.
Common situations: Connector metadata code building discrete predicates from dynamically computed column sets that turn out empty; passing predicates with no projected columns when the table has no predicate-relevant columns.
Related errors
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/db1304bfe9a24809.
Report an issue: GitHub.