apache/flink · error · IllegalArgumentException

A predicate on a BOOLEAN column requires a Boolean literal.

Error message

A predicate on a BOOLEAN column requires a Boolean literal.

What it means

For an ORC BOOLEAN-typed column, the pushed-down literal must be a java Boolean; anything else (String 'true', Integer 1/0, etc.) throws IllegalArgumentException, since SearchArgument stores boolean predicates as Boolean objects.

Source

Thrown at flink-formats/flink-orc/src/main/java/org/apache/flink/orc/OrcFilters.java:453

                        return ((BigDecimal) literal).doubleValue();
                    } else {
                        throw new IllegalArgumentException(
                                "A predicate on a FLOAT column requires a floating "
                                        + "literal, i.e., Float or Double.");
                    }
                case STRING:
                    if (literal instanceof String) {
                        return literal;
                    } else {
                        throw new IllegalArgumentException(
                                "A predicate on a STRING column requires a floating "
                                        + "literal, i.e., Float or Double.");
                    }
                case BOOLEAN:
                    if (literal instanceof Boolean) {
                        return literal;
                    } else {
                        throw new IllegalArgumentException(
                                "A predicate on a BOOLEAN column requires a Boolean literal.");
                    }
                case DATE:
                    if (literal instanceof Date) {
                        return literal;
                    } else {
                        throw new IllegalArgumentException(
                                "A predicate on a DATE column requires a java.sql.Date literal.");
                    }
                case TIMESTAMP:
                    if (literal instanceof Timestamp) {
                        return literal;
                    } else {
                        throw new IllegalArgumentException(
                                "A predicate on a TIMESTAMP column requires a java.sql.Timestamp literal.");
                    }
                case DECIMAL:
                    if (literal instanceof BigDecimal) {

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Convert the literal to Boolean before building the predicate (e.g. value == 1, Boolean.parseBoolean(s), with explicit handling for 0/1 encodings).
  2. Write SQL predicates against BOOLEAN columns as flag = true, not flag = 1.
  3. Use the modern ORC filesystem connector pushdown which applies proper literal conversion.

Example fix

-- before
SELECT * FROM orc_t WHERE flag = 1;
-- after
SELECT * FROM orc_t WHERE flag = true;
Defensive patterns

Strategy: type-guard

Validate before calling

Object lit;
if (value instanceof Boolean) lit = value;
else if (value instanceof Number) lit = ((Number) value).intValue() != 0;
else if (value instanceof String) lit = Boolean.parseBoolean((String) value);
else throw new IllegalArgumentException("BOOLEAN column needs a Boolean literal");

Type guard

static boolean isBooleanPushable(Object v) { return v instanceof Boolean; }

Prevention

When it happens

Trigger: A predicate like flag = 1 or flag = 'true' on a BOOLEAN ORC column via the legacy OrcFilters pushdown; programmatic filter construction passing a numeric or string representation of a boolean.

Common situations: Systems encoding booleans as 0/1 (JDBC sources, Parquet-to-ORC conversions) feeding filters unconverted; configuration-driven filter values arriving as strings.

Related errors


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/891a90749bca0828. Report an issue: GitHub.