{"record":{"id":"421fc2793765e609","repo":"prestodb/presto","slug":"nested-column-s-type-is-not-present-in-hive-col","errorCode":null,"errorMessage":"nested column [%s] type is not present in Hive column type","messagePattern":"nested column \\[(.+?)\\] type is not present in Hive column type","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/optimizer/IcebergParquetDereferencePushDown.java","lineNumber":111,"sourceCode":"            Subfield subfield,\n            Type subfieldDataType,\n            String subfieldColumnName)\n    {\n        checkArgument(baseColumnHandle instanceof IcebergColumnHandle,\n                \"Expected Iceberg column handle, instead got: \" + baseColumnHandle.getClass());\n\n        IcebergColumnHandle icebergBaseColumnHandle = (IcebergColumnHandle) baseColumnHandle;\n        Type type = icebergBaseColumnHandle.getType();\n        checkArgument(type instanceof RowType, \"%s must be type of RowType\", subfield.getRootName());\n\n        Optional<HiveType> nestedColumnHiveType = toHiveType(type)\n                .findChildType(subfield.getPath()\n                        .stream()\n                        .map(p -> ((Subfield.NestedField) p).getName())\n                        .collect(Collectors.toList()));\n\n        if (!nestedColumnHiveType.isPresent()) {\n            throw new IllegalArgumentException(\"nested column [\" + subfield + \"] type is not present in Hive column type\");\n        }\n\n        Type pushdownColumnType = nestedColumnHiveType.get().getType(typeManager);\n\n        return getSynthesizedIcebergColumnHandle(subfieldColumnName, pushdownColumnType, ImmutableList.of(subfield));\n    }\n}\n","sourceCodeStart":93,"sourceCodeEnd":119,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/optimizer/IcebergParquetDereferencePushDown.java#L93-L119","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Refresh the query/client so the Iceberg table metadata and column handles are re-read after schema evolution.","Verify the nested field still exists: check the current Iceberg schema and update views/saved queries referencing removed fields.","Align the Hive/Glue metastore column type with the Iceberg schema if they have drifted.","If the mismatch persists across fresh sessions, file a bug with the schema evolution history."],"exampleFix":"// before\nSELECT col.child_field FROM iceberg.db.t  -- child_field was dropped by ALTER TABLE DROP COLUMN\n// after\nSELECT col.remaining_field FROM iceberg.db.t  -- updated to the evolved schema","handlingStrategy":"validation","validationCode":"-- confirm the nested field exists before querying after schema evolution\nSELECT column_name, comment FROM iceberg.information_schema.columns\nWHERE table_schema='db' AND table_name='t';","typeGuard":null,"tryCatchPattern":"try {\n  rs = stmt.executeQuery(\"SELECT col.child FROM iceberg.db.t\");\n} catch (SQLException e) {\n  if (e.getMessage().contains(\"type is not present in Hive column type\")) {\n    // refresh schema/metadata and update the query to the evolved schema\n  }\n}","preventionTips":["After ALTER TABLE DROP/RENAME COLUMN, update views and saved queries referencing nested fields.","Keep Hive/Glue metastore schema in sync with Iceberg metadata.","Open fresh sessions after schema evolution to drop stale metadata caches.","Validate nested paths against the current schema in CI for generated SQL."],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}