prestodb/presto · error · ArrowException

ARROW_FLIGHT_TYPE_ERROR

ARROW_FLIGHT_TYPE_ERROR

Error message

Unsupported type: {type}

What it means

prestoToArrowType maps a Presto Type to an Arrow MinorType when constructing Arrow Flight payloads. If the Presto type has no supported Arrow mapping (e.g. IPADDRESS, unknown or custom types), it throws this ArrowException with code ARROW_FLIGHT_TYPE_ERROR, aborting schema creation for the VectorSchemaRoot.

Source

Thrown at presto-common-arrow/src/main/java/com/facebook/plugin/arrow/BlockArrowWriter.java:182

        }
        else if (type instanceof DateType) {
            return Types.MinorType.DATEDAY.getType();
        }
        else if (type instanceof TimeType) {
            return Types.MinorType.TIMEMILLI.getType();
        }
        else if (type instanceof TimeWithTimeZoneType) {
            // Unpack time from packed time with timezone
            return Types.MinorType.TIMEMILLI.getType();
        }
        else if (type instanceof TimestampType) {
            return Types.MinorType.TIMESTAMPMILLI.getType();
        }
        else if (type instanceof TimestampWithTimeZoneType) {
            // Read as plain timestamp and unpack to UTC, timezone not supplied with type
            return Types.MinorType.TIMESTAMPMILLI.getType();
        }
        throw new ArrowException(ARROW_FLIGHT_TYPE_ERROR, "Unsupported type: " + type);
    }

    public static VectorSchemaRoot createArrowWriters(BufferAllocator allocator, List<ColumnMetadata> columns, ImmutableList.Builder<ArrowVectorWriter> writerBuilder)
    {
        List<Field> fields = columns.stream().map(BlockArrowWriter::prestoToArrowField).collect(Collectors.toList());
        Schema schema = new Schema(fields);
        VectorSchemaRoot root = VectorSchemaRoot.create(schema, allocator);

        final List<FieldVector> vectors = root.getFieldVectors();
        checkArgument(vectors.size() == columns.size(), "Unexpected list of vectors: %s", schema);
        for (int i = 0; i < vectors.size(); i++) {
            ColumnMetadata columnMetadata = columns.get(i);
            writerBuilder.add(createArrowWriter(vectors.get(i), columnMetadata.getType()));
        }

        return root;
    }

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Cast or exclude unsupported columns in the query (CAST to VARCHAR or supported types)
  2. Extend prestoToArrowType with a mapping for the unsupported Presto type
  3. Catch ArrowException with code ARROW_FLIGHT_TYPE_ERROR and fall back to a non-Arrow serialization path

Example fix

// before
throw new ArrowException(ARROW_FLIGHT_TYPE_ERROR, "Unsupported type: " + type);
// after
else if (type instanceof IpaddressType) {
    return Types.MinorType.VARCHAR.getType(); // or add explicit mapping before this line
}
Defensive patterns

Strategy: validation

Validate before calling

Set<Class<?>> supported = Set.of(BigintType.class, VarcharType.class, DoubleType.class, TimestampType.class, ArrayType.class, MapType.class, RowType.class);
if (columns.stream().anyMatch(c -> !supported.contains(c.getType().getClass()))) {
    throw new IllegalStateException("Column not supported for Arrow Flight: " + columns);
}

Type guard

boolean isArrowSerializable(Type type) {
    return type instanceof BigintType || type instanceof VarcharType || type instanceof DoubleType
        || type instanceof TimestampType || type instanceof ArrayType
        || type instanceof MapType || type instanceof RowType;
}

Try / catch

try {
    VectorSchemaRoot root = BlockArrowWriter.createArrowWriters(allocator, columns, writerBuilder);
} catch (ArrowException e) {
    if (e.getCode() != ARROW_FLIGHT_TYPE_ERROR) throw e;
    // fall back to a non-Arrow serialization path or drop/cast the offending column
}

Prevention

When it happens

Trigger: Calling prestoToArrowType (directly or via arrowType/prestoToArrowField during createArrowWriters) with a Presto Type not covered by the if/else chain, such as IpAddressType, HyperLogLog, custom parametric types, or newly added Presto types the connector hasn't mapped.

Common situations: A Presto table contains columns of exotic types (ipaddress, hyperloglog, qdigest) and a query/scan attempts Arrow Flight transfer; connector updated to a newer Presto with new types but the Arrow mapping chain wasn't extended.

Related errors


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