{"record":{"id":"d0cfe1f7a8a3b5b8","repo":"prestodb/presto","slug":"unsupported-type-d0cfe1","errorCode":null,"errorMessage":"Unsupported type ","messagePattern":"Unsupported type ","errorType":"exception","errorClass":"VerifyError","httpStatus":null,"severity":"error","filePath":"presto-orc/src/main/java/com/facebook/presto/orc/reader/LongDirectBatchStreamReader.java","lineNumber":188,"sourceCode":"        if (type instanceof TimeType) {\n            long[] values = new long[nextBatchSize];\n            dataStream.next(values, nextBatchSize);\n            for (int i = 0; i < values.length; i++) {\n                values[i] = convertUnits.apply(values[i]);\n            }\n            return new LongArrayBlock(nextBatchSize, Optional.empty(), values);\n        }\n        if (type instanceof IntegerType || type instanceof DateType) {\n            int[] values = new int[nextBatchSize];\n            dataStream.next(values, nextBatchSize);\n            return new IntArrayBlock(nextBatchSize, Optional.empty(), values);\n        }\n        if (type instanceof SmallintType) {\n            short[] values = new short[nextBatchSize];\n            dataStream.next(values, nextBatchSize);\n            return new ShortArrayBlock(nextBatchSize, Optional.empty(), values);\n        }\n        throw new VerifyError(\"Unsupported type \" + type);\n    }\n\n    private Block readNullBlock(boolean[] isNull, int nonNullCount)\n            throws IOException\n    {\n        if (type instanceof BigintType) {\n            return longReadNullBlock(isNull, nonNullCount);\n        }\n        if (type instanceof TimeType) {\n            return longReadNullBlock(isNull, nonNullCount);\n        }\n        if (type instanceof IntegerType || type instanceof DateType) {\n            return intReadNullBlock(isNull, nonNullCount);\n        }\n        if (type instanceof SmallintType) {\n            return shortReadNullBlock(isNull, nonNullCount);\n        }\n        throw new VerifyError(\"Unsupported type \" + type);","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/reader/LongDirectBatchStreamReader.java#L170-L206","documentation":"readNonNullBlock decodes a direct data stream into blocks based on the column's type, supporting BigintType, IntegerType, and SmallintType. Any other type reaching this reader is unsupported and triggers VerifyError(\"Unsupported type \" + type), indicating the stream reader was constructed for a type it cannot decode — a logic/metadata mismatch rather than data corruption.","triggerScenarios":"readBlock -> readNonNullBlock with a type other than BIGINT/INTEGER/SMALLINT (e.g. DateType or a custom type) mapped onto LongDirectBatchStreamReader.","commonSituations":"Plugin/connector code creating the wrong stream reader for a type; engine changes mapping new types to the long reader; version skew between Presto nodes (mixed coordinator/worker builds) causing inconsistent type mappings.","solutions":["Fix the reader factory so the type is mapped to a matching stream reader (e.g. use LongStreamReader or DateStreamReader for DATE)","Ensure all nodes run the same Presto version to avoid inconsistent type mapping","Check for custom connectors/plugins overriding type-to-reader mappings and correct them","Upgrade Presto if the type support was added in a newer release"],"exampleFix":"// before\nreturn new LongDirectBatchStreamReader(type, ...); // type = DateType\n// after\nreturn new LongStreamReader.StreamReaderFactory(type, ...); // reader matching the declared type","handlingStrategy":"type-guard","validationCode":"// Java: before constructing the reader\nif (!(type instanceof BigintType) && !(type instanceof IntegerType) && !(type instanceof SmallintType)) {\n    throw new PrestoException(NOT_SUPPORTED, \"Type not supported by long stream reader: \" + type);\n}","typeGuard":"// Java narrowing helper\nstatic boolean supportedByLongReader(Type t) {\n    return t instanceof BigintType || t instanceof IntegerType || t instanceof SmallintType;\n}","tryCatchPattern":"// Cannot meaningfully catch VerifyError; prevent instead:\n// if (!supportedByLongReader(type)) { use reader factory for type; }","preventionTips":["Map every Type to its matching stream reader in the reader factory","Pin all cluster nodes to the same Presto version","Review custom connector type mappings for drift","Add unit tests covering all supported types per reader"],"tags":["orc","type-mismatch","unsupported-type","presto"],"backgroundTag":"unsupported-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"}