prestodb/presto · error · UnsupportedOperationException

Type is not supported: ${type}

Error message

Type is not supported: ${type}

What it means

KuduPageSink.appendColumn converts each column's Block value into a Kudu PartialRow. Unsupported Kudu column types (e.g. array/map/row complex types in the sink path) fall through all typed branches and hit this UnsupportedOperationException. It is a coding/config-level limitation of the connector's type mapping, not a data error.

Source

Thrown at presto-kudu/src/main/java/com/facebook/presto/kudu/KuduPageSink.java:183

            if (DATE.equals(originalType)) {
                SqlDate date = (SqlDate) originalType.getObjectValue(connectorSession.getSqlFunctionProperties(), block, position);
                LocalDateTime ldt = LocalDateTime.ofEpochSecond(TimeUnit.DAYS.toSeconds(date.getDays()), 0, ZoneOffset.UTC);
                byte[] bytes = ldt.format(DateTimeFormatter.ISO_LOCAL_DATE).getBytes(StandardCharsets.UTF_8);
                row.addStringUtf8(destChannel, bytes);
            }
            else {
                row.addString(destChannel, type.getSlice(block, position).toStringUtf8());
            }
        }
        else if (VARBINARY.equals(type)) {
            row.addBinary(destChannel, type.getSlice(block, position).toByteBuffer());
        }
        else if (type instanceof DecimalType) {
            SqlDecimal sqlDecimal = (SqlDecimal) type.getObjectValue(connectorSession.getSqlFunctionProperties(), block, position);
            row.addDecimal(destChannel, sqlDecimal.toBigDecimal());
        }
        else {
            throw new UnsupportedOperationException("Type is not supported: " + type);
        }
    }

    @Override
    public CompletableFuture<Collection<Slice>> finish()
    {
        closeSession();
        return completedFuture(ImmutableList.of());
    }

    @Override
    public void abort()
    {
        closeSession();
    }

    private void closeSession()
    {

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Ensure the inserted query only selects Kudu-supported types (bigint, varchar, double, boolean, timestamp, decimal, varbinary, etc.)
  2. CAST unsupported columns (e.g. to JSON/varchar) before inserting into Kudu
  3. Extend appendColumn with a branch for the missing type if you maintain the connector

Example fix

// before
INSERT INTO kudu.t SELECT complex_col FROM src;
// after
INSERT INTO kudu.t SELECT CAST(json_format(CAST(complex_col AS JSON)) AS VARCHAR) FROM src;
Defensive patterns

Strategy: type-guard

Validate before calling

List<String> kuduSupported = List.of("boolean","tinyint","smallint","integer","bigint","real","double","varchar","varbinary","timestamp","decimal");
for (ColumnHandle c : columns) {
    String t = types.get(c).getDisplayName();
    if (!kuduSupported.stream().anyMatch(t::startsWith)) {
        throw new IllegalArgumentException("Column type not supported by Kudu sink: " + t);
    }
}

Type guard

boolean isKuduWritable(Type type) {
    return type instanceof BigintType || type instanceof VarcharType || type instanceof DoubleType
        || type instanceof BooleanType || type instanceof TimestampType || type instanceof DecimalType
        || type instanceof VarbinaryType || type instanceof SmallintType || type instanceof TinyintType
        || type instanceof RealType || type instanceof IntegerType;
}

Try / catch

try {
    pageSink.appendPage(page);
} catch (UnsupportedOperationException e) {
    if (e.getMessage().startsWith("Type is not supported")) {
        throw new IllegalArgumentException("CAST unsupported column before inserting into Kudu: " + e.getMessage(), e);
    }
    throw e;
}

Prevention

When it happens

Trigger: Writing a page containing a column whose Presto type has no Kudu mapping in appendColumn, e.g. ARRAY or MAP columns, or a newly added Presto type not yet handled by the sink.

Common situations: SELECT * from a table with complex-typed columns and INSERT into a Kudu table; connector upgrades introducing new types not yet mapped in KuduPageSink.

Related errors


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