{"record":{"id":"b93ef8c26387083a","repo":"prestodb/presto","slug":"type-is-not-supported-type","errorCode":null,"errorMessage":"Type is not supported: ${type}","messagePattern":"Type is not supported: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"presto-kudu/src/main/java/com/facebook/presto/kudu/KuduPageSink.java","lineNumber":183,"sourceCode":"            if (DATE.equals(originalType)) {\n                SqlDate date = (SqlDate) originalType.getObjectValue(connectorSession.getSqlFunctionProperties(), block, position);\n                LocalDateTime ldt = LocalDateTime.ofEpochSecond(TimeUnit.DAYS.toSeconds(date.getDays()), 0, ZoneOffset.UTC);\n                byte[] bytes = ldt.format(DateTimeFormatter.ISO_LOCAL_DATE).getBytes(StandardCharsets.UTF_8);\n                row.addStringUtf8(destChannel, bytes);\n            }\n            else {\n                row.addString(destChannel, type.getSlice(block, position).toStringUtf8());\n            }\n        }\n        else if (VARBINARY.equals(type)) {\n            row.addBinary(destChannel, type.getSlice(block, position).toByteBuffer());\n        }\n        else if (type instanceof DecimalType) {\n            SqlDecimal sqlDecimal = (SqlDecimal) type.getObjectValue(connectorSession.getSqlFunctionProperties(), block, position);\n            row.addDecimal(destChannel, sqlDecimal.toBigDecimal());\n        }\n        else {\n            throw new UnsupportedOperationException(\"Type is not supported: \" + type);\n        }\n    }\n\n    @Override\n    public CompletableFuture<Collection<Slice>> finish()\n    {\n        closeSession();\n        return completedFuture(ImmutableList.of());\n    }\n\n    @Override\n    public void abort()\n    {\n        closeSession();\n    }\n\n    private void closeSession()\n    {","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-kudu/src/main/java/com/facebook/presto/kudu/KuduPageSink.java#L165-L201","documentation":"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.","triggerScenarios":"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.","commonSituations":"SELECT * from a table with complex-typed columns and INSERT into a Kudu table; connector upgrades introducing new types not yet mapped in KuduPageSink.","solutions":["Ensure the inserted query only selects Kudu-supported types (bigint, varchar, double, boolean, timestamp, decimal, varbinary, etc.)","CAST unsupported columns (e.g. to JSON/varchar) before inserting into Kudu","Extend appendColumn with a branch for the missing type if you maintain the connector"],"exampleFix":"// before\nINSERT INTO kudu.t SELECT complex_col FROM src;\n// after\nINSERT INTO kudu.t SELECT CAST(json_format(CAST(complex_col AS JSON)) AS VARCHAR) FROM src;","handlingStrategy":"type-guard","validationCode":"List<String> kuduSupported = List.of(\"boolean\",\"tinyint\",\"smallint\",\"integer\",\"bigint\",\"real\",\"double\",\"varchar\",\"varbinary\",\"timestamp\",\"decimal\");\nfor (ColumnHandle c : columns) {\n    String t = types.get(c).getDisplayName();\n    if (!kuduSupported.stream().anyMatch(t::startsWith)) {\n        throw new IllegalArgumentException(\"Column type not supported by Kudu sink: \" + t);\n    }\n}","typeGuard":"boolean isKuduWritable(Type type) {\n    return type instanceof BigintType || type instanceof VarcharType || type instanceof DoubleType\n        || type instanceof BooleanType || type instanceof TimestampType || type instanceof DecimalType\n        || type instanceof VarbinaryType || type instanceof SmallintType || type instanceof TinyintType\n        || type instanceof RealType || type instanceof IntegerType;\n}","tryCatchPattern":"try {\n    pageSink.appendPage(page);\n} catch (UnsupportedOperationException e) {\n    if (e.getMessage().startsWith(\"Type is not supported\")) {\n        throw new IllegalArgumentException(\"CAST unsupported column before inserting into Kudu: \" + e.getMessage(), e);\n    }\n    throw e;\n}","preventionTips":["Describe the Kudu target table and match source SELECT column types to it","CAST complex/JSON types to varchar before inserting","Keep connector type mappings updated after Presto upgrades"],"tags":["kudu","sink","unsupported-type"],"backgroundTag":"unsupported-column-type","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"}