apache/iceberg · error · IllegalArgumentException

Can't handle

Error message

Can't handle 

What it means

EstimateOrcAvgWidthVisitor.primitive() estimates average column width for ORC pushdown planning and supports only a fixed set of primitive categories; for any unsupported primitive it throws IllegalArgumentException("Can't handle " + type), because no width estimate exists.

Solutions

  1. Upgrade Iceberg so the estimator supports the column type.
  2. Change the column type to a supported primitive (e.g., string/binary/decimal).
  3. Disable filter pushdown for the scan/table if the estimator path is avoidable.
  4. Rewrite the data files with supported types.

Example fix

// before
Types.TimestampNanoType.get() // unsupported by estimator -> Can't handle
// after
ALTER TABLE ... ALTER COLUMN ts TYPE TIMESTAMP; // supported type
Defensive patterns

Strategy: try-catch

Validate before calling

// restrict schema to estimator-supported primitives before pushdown
for (Types.NestedField f : schema.columns()) { /* check f.type() against supported set */ }

Try / catch

try { scan.planFiles(); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith("Can't handle")) { /* fall back to non-pushdown scan or rewrite */ } throw e; }

Prevention

When it happens

Trigger: Scan planning/filter pushdown on an ORC table whose schema contains a primitive type the estimator lacks a case for (e.g., certain date/time or newly added types).

Common situations: Using predicates pushdown with newer Iceberg types against older ORC module code; exotic ORC file types; reading files written by other engines with unusual type mapping.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at orc/src/main/java/org/apache/iceberg/orc/EstimateOrcAvgWidthVisitor.java:76

      case SHORT:
      case INT:
      case FLOAT:
      case BOOLEAN:
      case LONG:
      case DOUBLE:
      case DATE:
        return 8;
      case TIMESTAMP:
      case TIMESTAMP_INSTANT:
        return 12;
      case STRING:
      case VARCHAR:
      case BINARY:
        return 128;
      case DECIMAL:
        return primitive.getPrecision() + 2;
      default:
        throw new IllegalArgumentException("Can't handle " + primitive);
    }
  }
}

View on GitHub (pinned to 86d9c8fc54)