apache/iceberg · error · UnsupportedOperationException

AlwaysFalse is a placeholder only

Error message

AlwaysFalse is a placeholder only

What it means

AlwaysFalse in ParquetFilters is only a placeholder FilterPredicate used as a marker when converting expressions; it has no visitor implementation. Calling accept(Visitor) always throws UnsupportedOperationException because it is never meant to be evaluated as a real filter.

Solutions

  1. Short-circuit: treat a converted alwaysFalse predicate as 'return no rows' without invoking a visitor
  2. Use parquet-mr's FilterApi.alwaysFalse() if an actual always-reject filter object is needed

Example fix

// before
FilterPredicate p = ParquetFilters.predicate(Expressions.alwaysFalse());
visitor.visit(p); // throws
// after
if (expr == Expressions.alwaysFalse()) { return CloseableIterable.empty(); }
Defensive patterns

Strategy: type-guard

Validate before calling

if (pred instanceof ParquetFilters.AlwaysFalse) { /* return empty result set */ }

Type guard

static boolean isPlaceholder(FilterPredicate p) {
  return p instanceof ParquetFilters.AlwaysTrue || p instanceof ParquetFilters.AlwaysFalse;
}

Try / catch

if (!isPlaceholder(pred)) {
  visitor.visit(pred);
} else {
  // sentinel: produce empty result, do not call accept()
}

Prevention

When it happens

Trigger: Passing ParquetFilters.AlwaysFalse.INSTANCE into a Parquet FilterPredicate Visitor or composing it via and()/or() and then evaluating the resulting tree.

Common situations: Expressions that bind to alwaysFalse (e.g. comparing incompatible values) get converted to the sentinel, then downstream code attempts to visit/evaluate the predicate instead of short-circuiting to an empty result.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/9659624ab8f981e2. Report an issue: GitHub.

Appendix: source

Thrown at parquet/src/main/java/org/apache/iceberg/parquet/ParquetFilters.java:251

    throw new UnsupportedOperationException(
        "Type not supported yet: " + value.getClass().getName());
  }

  private static class AlwaysTrue implements FilterPredicate {
    static final AlwaysTrue INSTANCE = new AlwaysTrue();

    @Override
    public <R> R accept(Visitor<R> visitor) {
      throw new UnsupportedOperationException("AlwaysTrue is a placeholder only");
    }
  }

  private static class AlwaysFalse implements FilterPredicate {
    static final AlwaysFalse INSTANCE = new AlwaysFalse();

    @Override
    public <R> R accept(Visitor<R> visitor) {
      throw new UnsupportedOperationException("AlwaysFalse is a placeholder only");
    }
  }
}

View on GitHub (pinned to 86d9c8fc54)