{"record":{"id":"5aabb3b56788b4ca","repo":"prestodb/presto","slug":"pinot-unsupported-column-type","errorCode":"PINOT_UNSUPPORTED_COLUMN_TYPE","errorMessage":"type '' not supported","messagePattern":"type '' not supported","errorType":"error_code","errorClass":"PinotException","httpStatus":null,"severity":"error","filePath":"presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/PinotBrokerPageSource.java","lineNumber":154,"sourceCode":"            }\n            blockBuilder.closeEntry();\n        }\n        else {\n            setValue(type, blockBuilder, asText(value));\n        }\n    }\n\n    protected void setValue(Type type, BlockBuilder blockBuilder, String value)\n    {\n        if (blockBuilder == null) {\n            return;\n        }\n        if (value == null) {\n            blockBuilder.appendNull();\n            return;\n        }\n        if (!isTypeSupportInPinot(type)) {\n            throw new PinotException(PINOT_UNSUPPORTED_COLUMN_TYPE, Optional.empty(), \"type '\" + type + \"' not supported\");\n        }\n        if (type instanceof FixedWidthType) {\n            completedBytes += ((FixedWidthType) type).getFixedSize();\n            if (type instanceof BigintType) {\n                type.writeLong(blockBuilder, parseDouble(value).longValue());\n            }\n            else if (type instanceof IntegerType) {\n                blockBuilder.writeInt(parseDouble(value).intValue());\n            }\n            else if (type instanceof TinyintType) {\n                blockBuilder.writeByte(parseDouble(value).byteValue());\n            }\n            else if (type instanceof SmallintType) {\n                blockBuilder.writeShort(parseDouble(value).shortValue());\n            }\n            else if (type instanceof BooleanType) {\n                type.writeBoolean(blockBuilder, parseBoolean(value));\n            }","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-pinot-toolkit/src/main/java/com/facebook/presto/pinot/PinotBrokerPageSource.java#L136-L172","documentation":"PinotBrokerPageSource.setValue throws PinotException(PINOT_UNSUPPORTED_COLUMN_TYPE) when a value read from a Pinot broker query response must be written into a Presto block, but the column's Presto Type is not supported by the Pinot connector. This first check catches types that fail isTypeSupportInPinot(type) — i.e. types the connector has no mapping/decoding path for — before any per-type write logic runs. It means the selected table column has a type the connector cannot materialize.","triggerScenarios":"A query selects a Pinot column whose mapped Presto type is not in the connector's supported set (checked by isTypeSupportInPinot) — e.g. exotic Pinot derived/multi-value columns, map/array types, or types added to Pinot but not to the connector — and the broker page source tries to decode the JSON value into that type.","commonSituations":"Schema evolution: a column was added or its type changed in Pinot after the connector cached metadata; queries with function-derived expressions producing unsupported types; selecting RAW/JSON or multi-value Pinot columns directly; connector version older than the Pinot cluster's type surface.","solutions":["Cast the offending column to a supported type in the query (e.g. CAST(col AS VARCHAR) or CAST(col AS BIGINT))","Check isTypeSupportInPinot in PinotBrokerPageSource/PinotColumnHandle to see which types are supported, and avoid selecting unsupported columns","Refresh the connector's schema metadata (restart coordinator or invalidate the Pinot table schema cache) if the Pinot schema changed recently","Upgrade the Presto/Pinot connector version so newer Pinot types are mapped","Exclude the unsupported column from SELECT * and list only supported columns explicitly"],"exampleFix":"// before\nSELECT * FROM pinot_table\n// after\nSELECT CAST(unsupported_col AS VARCHAR) AS unsupported_col, id FROM pinot_table","handlingStrategy":"validation","validationCode":"-- Inspect the mapped schema before querying; avoid unsupported types\nSELECT column_name, data_type FROM information_schema.columns\nWHERE table_schema = 'pinot_schema' AND table_name = 'my_table';\n-- Or in code: only pass supported types to the Pinot connector\nSet<Class<?>> supported = Set.of(BigintType.class, IntegerType.class, DoubleType.class,\n    RealType.class, TimestampType.class, DateType.class, VarcharType.class, VarbinaryType.class);","typeGuard":"boolean isPinotSupported(Type type) {\n  return type instanceof BigintType || type instanceof IntegerType\n      || type instanceof SmallintType || type instanceof TinyintType\n      || type instanceof DoubleType || type instanceof RealType\n      || type instanceof TimestampType || type instanceof DateType\n      || type instanceof VarcharType || type instanceof VarbinaryType;\n}","tryCatchPattern":"try (PinotBrokerPageSource source = ...) {\n  return source.getNextPage();\n} catch (PinotException e) {\n  if (e.getErrorCode() == PINOT_UNSUPPORTED_COLUMN_TYPE.toErrorCode()) {\n    throw new IllegalArgumentException(\"Query selects a column type the Pinot connector cannot decode; cast it or drop it\");\n  }\n  throw e;\n}","preventionTips":["Avoid SELECT * on Pinot tables; list only columns with supported types","Cast derived/exotic expressions to VARCHAR or BIGINT at query time","Re-sync metadata when the Pinot schema changes; avoid stale cached column types","Keep connector and Presto versions aligned with the Pinot cluster version","Add integration tests that query every column of the table to catch unmapped types early"],"tags":["pinot","unsupported-type","type-mapping","presto"],"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"}