prestodb/presto · error · IllegalArgumentException

nested column [%s] type is not present in Hive column type

Error message

nested column [%s] type is not present in Hive column type

What it means

IcebergParquetDereferencePushDown synthesizes an IcebergColumnHandle for a dereferenced nested subfield by looking up the subfield's path in the corresponding Hive column type. If findChildType cannot find the nested path in that Hive type, it throws IllegalArgumentException 'nested column [...] type is not present in Hive column type', indicating the Iceberg schema and Hive metastore schema are out of sync.

Source

Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/optimizer/IcebergParquetDereferencePushDown.java:111

            Subfield subfield,
            Type subfieldDataType,
            String subfieldColumnName)
    {
        checkArgument(baseColumnHandle instanceof IcebergColumnHandle,
                "Expected Iceberg column handle, instead got: " + baseColumnHandle.getClass());

        IcebergColumnHandle icebergBaseColumnHandle = (IcebergColumnHandle) baseColumnHandle;
        Type type = icebergBaseColumnHandle.getType();
        checkArgument(type instanceof RowType, "%s must be type of RowType", subfield.getRootName());

        Optional<HiveType> nestedColumnHiveType = toHiveType(type)
                .findChildType(subfield.getPath()
                        .stream()
                        .map(p -> ((Subfield.NestedField) p).getName())
                        .collect(Collectors.toList()));

        if (!nestedColumnHiveType.isPresent()) {
            throw new IllegalArgumentException("nested column [" + subfield + "] type is not present in Hive column type");
        }

        Type pushdownColumnType = nestedColumnHiveType.get().getType(typeManager);

        return getSynthesizedIcebergColumnHandle(subfieldColumnName, pushdownColumnType, ImmutableList.of(subfield));
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Refresh the query/client so the Iceberg table metadata and column handles are re-read after schema evolution.
  2. Verify the nested field still exists: check the current Iceberg schema and update views/saved queries referencing removed fields.
  3. Align the Hive/Glue metastore column type with the Iceberg schema if they have drifted.
  4. If the mismatch persists across fresh sessions, file a bug with the schema evolution history.

Example fix

// before
SELECT col.child_field FROM iceberg.db.t  -- child_field was dropped by ALTER TABLE DROP COLUMN
// after
SELECT col.remaining_field FROM iceberg.db.t  -- updated to the evolved schema
Defensive patterns

Strategy: validation

Validate before calling

-- confirm the nested field exists before querying after schema evolution
SELECT column_name, comment FROM iceberg.information_schema.columns
WHERE table_schema='db' AND table_name='t';

Try / catch

try {
  rs = stmt.executeQuery("SELECT col.child FROM iceberg.db.t");
} catch (SQLException e) {
  if (e.getMessage().contains("type is not present in Hive column type")) {
    // refresh schema/metadata and update the query to the evolved schema
  }
}

Prevention

When it happens

Trigger: Pushing down a subfield reference (a.b.c) on an Iceberg table whose Hive-side column type no longer contains that nested field — schema evolution (field dropped/renamed in Iceberg) not reflected in the cached Hive column type, or stale column handles after ALTER TABLE DROP/RENAME COLUMN.

Common situations: Iceberg schema evolution (DROP/RENAME of nested fields) racing against cached metadata; Glue/Hive metastore schema drifted from Iceberg metadata; queries referencing stale nested columns in views or saved queries after evolution.


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/421fc2793765e609. Report an issue: GitHub.