prestodb/presto · error · PrestoException

NOT_SUPPORTED

NOT_SUPPORTED

Error message

Unsupported primitive type: %s

What it means

Type-mapping guard in getPrimitiveType: the connector table declares a primitive type that has no Parquet primitive equivalent after all known cases (double, real, varchar/char/varbinary, ...) are exhausted. The table schema cannot be serialized to Parquet.

Source

Thrown at presto-parquet/src/main/java/com/facebook/presto/parquet/writer/ParquetSchemaConverter.java:156

            return parquetTypeBuilder.named(name);
        }
        if (DOUBLE.equals(type)) {
            return Types.primitive(PrimitiveType.PrimitiveTypeName.DOUBLE, repetition).named(name);
        }
        if (RealType.REAL.equals(type)) {
            return Types.primitive(PrimitiveType.PrimitiveTypeName.FLOAT, repetition).named(name);
        }
        if (type instanceof VarcharType || type instanceof CharType || type instanceof VarbinaryType) {
            return Types.primitive(PrimitiveType.PrimitiveTypeName.BINARY, repetition).named(name);
        }
        if (type instanceof UuidType) {
            LogicalTypeAnnotation logicalTypeAnnotation = LogicalTypeAnnotation.uuidType();
            Types.PrimitiveBuilder<PrimitiveType> builder = Types.primitive(PrimitiveType.PrimitiveTypeName.FIXED_LEN_BYTE_ARRAY, repetition)
                    .length(16);
            builder = builder.as(logicalTypeAnnotation);
            return builder.named(name);
        }
        throw new PrestoException(NOT_SUPPORTED, format("Unsupported primitive type: %s", type));
    }

    private org.apache.parquet.schema.Type getArrayType(ArrayType type, String name, List<String> parent, Repetition repetition)
    {
        Type elementType = type.getElementType();
        return Types.list(repetition)
                .element(convert(elementType, "array", ImmutableList.<String>builder().addAll(parent).add(name).add("list").build(), OPTIONAL))
                .named(name);
    }

    private org.apache.parquet.schema.Type getMapType(MapType type, String name, List<String> parent, Repetition repetition)
    {
        parent = ImmutableList.<String>builder().addAll(parent).add(name).add("key_value").build();
        Type keyType = type.getKeyType();
        Type valueType = type.getValueType();
        return Types.map(repetition)
                .key(convert(keyType, "key", parent, REQUIRED))
                .value(convert(valueType, "value", parent, OPTIONAL))

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Change the column type to a Parquet-representable one before writing
  2. Add a mapping for the type in ParquetSchemaConverter (code change)
  3. Avoid CTAS/write into Parquet on tables containing that type
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at presto-parquet/src/main/java/com/facebook/presto/parquet/writer/ParquetSchemaConverter.java:156 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class

Background: Presto NOT_SUPPORTED error: what "not supported" means and how to fix it — this error's family across 3 libraries.


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