{"record":{"id":"f717e59e9d1cfcd5","repo":"prestodb/presto","slug":"generic-internal-error-f717e5","errorCode":"GENERIC_INTERNAL_ERROR","errorMessage":"CodePoints type cannot be serialized","messagePattern":"CodePoints type cannot be serialized","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"critical","filePath":"presto-main-base/src/main/java/com/facebook/presto/type/CodePointsType.java","lineNumber":40,"sourceCode":"import com.facebook.presto.spi.PrestoException;\n\nimport static com.facebook.presto.spi.StandardErrorCode.GENERIC_INTERNAL_ERROR;\n\npublic class CodePointsType\n        extends AbstractPrimitiveType\n{\n    public static final CodePointsType CODE_POINTS = new CodePointsType();\n    public static final String NAME = \"CodePoints\";\n\n    protected CodePointsType()\n    {\n        super(new TypeSignature(NAME), int[].class);\n    }\n\n    @Override\n    public BlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries, int expectedBytesPerEntry)\n    {\n        throw new PrestoException(GENERIC_INTERNAL_ERROR, \"CodePoints type cannot be serialized\");\n    }\n\n    @Override\n    public BlockBuilder createBlockBuilder(BlockBuilderStatus blockBuilderStatus, int expectedEntries)\n    {\n        throw new PrestoException(GENERIC_INTERNAL_ERROR, \"CodePoints type cannot be serialized\");\n    }\n\n    @Override\n    public Object getObjectValue(SqlFunctionProperties properties, Block block, int position)\n    {\n        throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public void appendTo(Block block, int position, BlockBuilder blockBuilder)\n    {\n        throw new UnsupportedOperationException();","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/type/CodePointsType.java#L22-L58","documentation":"CodePointsType does not support block serialization: its createBlockBuilder(expectedEntries, expectedBytesPerEntry) unconditionally throws GENERIC_INTERNAL_ERROR. CodePoints is an internal-only type (Java int[] underlying representation) and is not meant to cross the wire or be written to storage.","triggerScenarios":"Any execution path that attempts to serialize a column of type CodePoints, e.g. writing results to a spill/storage format or exchanging them between stages.","commonSituations":"Custom connectors/functions that accidentally expose CodePoints columns, or engine-internal bugs where the type leaks into serializable output.","solutions":["Do not surface CodePoints-typed values in query output or connector schemas; convert to VARCHAR/BIGINT first.","If hit inside the engine, treat as a bug and report with the query plan.","Use the matching serde path expected for the type, or switch the column type to a serializable one."],"exampleFix":"// before\noutputTypes.add(CodePointsType.CODE_POINTS);\n// after\noutputTypes.add(VARCHAR); // materialize code points as text","handlingStrategy":"type-guard","validationCode":"if (type instanceof CodePointsType) {\n    throw new UnsupportedOperationException(\"CodePoints is not serializable; convert to VARCHAR first\");\n}","typeGuard":"boolean isSerializable(Type t) { return !(t instanceof CodePointsType); }","tryCatchPattern":"try { blockBuilder = type.createBlockBuilder(status, n); } catch (PrestoException e) { /* GENERIC_INTERNAL_ERROR: exclude non-serializable types from output schema */ }","preventionTips":["Never include CodePoints columns in connector output schemas or serialized pages.","Convert CodePoints to VARCHAR/ARRAY(BIGINT) at the boundary.","Filter output types through a serializable-type allowlist."],"tags":["presto","internal-error","serialization","codepoints"],"backgroundTag":"type-not-serializable","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"}