{"record":{"id":"26eef8ad3346d675","repo":"prestodb/presto","slug":"expected-all-parameters-to-be-named-type-but-got","errorCode":null,"errorMessage":"Expected all parameters to be named type, but got %s","messagePattern":"Expected all parameters to be named type, but got (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/TypeConverter.java","lineNumber":383,"sourceCode":"        }\n        if (type instanceof DecimalType) {\n            DecimalType decimalType = (DecimalType) type;\n            return new DecimalTypeInfo(decimalType.getPrecision(), decimalType.getScale());\n        }\n        if (isArrayType(type)) {\n            TypeInfo elementType = toHiveTypeInfo(type.getTypeParameters().get(0));\n            return getListTypeInfo(elementType);\n        }\n        if (isMapType(type)) {\n            TypeInfo keyType = toHiveTypeInfo(type.getTypeParameters().get(0));\n            TypeInfo valueType = toHiveTypeInfo(type.getTypeParameters().get(1));\n            return getMapTypeInfo(keyType, valueType);\n        }\n        if (isRowType(type)) {\n            ImmutableList.Builder<String> fieldNames = ImmutableList.builder();\n            for (TypeSignatureParameter parameter : type.getTypeSignature().getParameters()) {\n                if (!parameter.isNamedTypeSignature()) {\n                    throw new IllegalArgumentException(format(\"Expected all parameters to be named type, but got %s\", parameter));\n                }\n                NamedTypeSignature namedTypeSignature = parameter.getNamedTypeSignature();\n                if (!namedTypeSignature.getName().isPresent()) {\n                    throw new PrestoException(NOT_SUPPORTED, format(\"Anonymous row type is not supported in Hive. Please give each field a name: %s\", type));\n                }\n                fieldNames.add(namedTypeSignature.getName().get());\n            }\n            return getStructTypeInfo(\n                    fieldNames.build(),\n                    type.getTypeParameters().stream()\n                            .map(TypeConverter::toHiveTypeInfo)\n                            .collect(toList()));\n        }\n        throw new PrestoException(NOT_SUPPORTED, format(\"Unsupported Hive type: %s\", type));\n    }\n\n    public static List<OrcType> toOrcType(Schema schema)\n    {","sourceCodeStart":365,"sourceCodeEnd":401,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/TypeConverter.java#L365-L401","documentation":"When converting an Iceberg (Presto) row type to a Hive struct type, every type-signature parameter must be a named field signature. This IllegalArgumentException is thrown if any parameter of the row type is a bare (unnamed) type parameter rather than a named field, since Hive struct types require field names.","triggerScenarios":"Calling toHiveType/toHiveTypeInfo (directly or via elementType/keyType/valueType) on a row Type whose TypeSignature contains a non-named TypeSignatureParameter (e.g. a nested plain type instead of row(name type,...)).","commonSituations":"Iceberg tables with row columns whose fields were never named; schemas built programmatically without field names; schema evolution or third-party writers producing anonymous nested structs.","solutions":["Give every nested row field an explicit name in the Iceberg schema (row(name type, ...)).","If the parameter is genuinely not a row parameter, extend toHiveTypeInfo with a branch handling that parameter kind.","Flatten or restructure the column so anonymous nested types are avoided."],"exampleFix":"// before (anonymous fields in schema)\nTypes.NestedField.of(1, false, \"s\", Types.StructType.of(Types.IntegerType.get(), Types.StringType.get()));\n// after\nTypes.NestedField.of(1, false, \"s\", Types.StructType.of(\n    Types.NestedField.of(2, true, \"count\", Types.IntegerType.get()),\n    Types.NestedField.of(3, true, \"name\", Types.StringType.get())));","handlingStrategy":"validation","validationCode":"for (TypeSignatureParameter p : type.getTypeSignature().getParameters()) {\n    if (!p.isNamedTypeSignature()) {\n        throw new IllegalArgumentException(\"Row type has unnamed parameter: \" + p);\n    }\n}","typeGuard":"boolean allNamedRowParams(Type type) {\n    return type.getTypeSignature().getParameters().stream().allMatch(TypeSignatureParameter::isNamedTypeSignature);\n}","tryCatchPattern":"try { hiveType = TypeConverter.toHiveType(icebergType); } catch (IllegalArgumentException e) { /* fix schema / skip column */ }","preventionTips":["Always name row fields in Iceberg DDL","Validate schema with allNamedRowParams before conversion","Add schema checks in CI for Iceberg tables consumed via Hive paths"],"tags":["iceberg","hive","type-conversion","row-type"],"backgroundTag":"anonymous-row-type-not-supported","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"}