{"record":{"id":"cfcdac854acb0885","repo":"prestodb/presto","slug":"unsupported-type-cfcdac","errorCode":null,"errorMessage":"Unsupported type: ","messagePattern":"Unsupported type: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-orc/src/main/java/com/facebook/presto/orc/reader/BatchStreamReaders.java","lineNumber":66,"sourceCode":"            case STRING:\n            case VARCHAR:\n            case CHAR:\n                return new SliceBatchStreamReader(type, streamDescriptor, systemMemoryContext, options.getMaxSliceSize(), options.isResetAllReaders());\n            case TIMESTAMP:\n            case TIMESTAMP_MICROSECONDS:\n                boolean enableMicroPrecision = type == TIMESTAMP_MICROSECONDS;\n                return new TimestampBatchStreamReader(type, streamDescriptor, enableMicroPrecision);\n            case LIST:\n                return new ListBatchStreamReader(type, streamDescriptor, options, systemMemoryContext);\n            case STRUCT:\n                return new StructBatchStreamReader(type, streamDescriptor, options, systemMemoryContext);\n            case MAP:\n                return new MapBatchStreamReader(type, streamDescriptor, options, systemMemoryContext);\n            case DECIMAL:\n                return new DecimalBatchStreamReader(type, streamDescriptor);\n            case UNION:\n            default:\n                throw new IllegalArgumentException(\"Unsupported type: \" + streamDescriptor.getOrcTypeKind());\n        }\n    }\n}\n","sourceCodeStart":48,"sourceCodeEnd":70,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-orc/src/main/java/com/facebook/presto/orc/reader/BatchStreamReaders.java#L48-L70","documentation":"BatchStreamReaders.createStreamReader throws this IllegalArgumentException when the ORC type kind of the stream descriptor has no corresponding batch stream reader implementation (falls through the switch default, e.g. UNION). Presto's ORC reader does not support decoding that type into a block.","triggerScenarios":"Reading an ORC file whose schema contains a type Presto's ORC reader cannot map (notably UNION types, or any kind missing from the switch) — encountered when a table/column is queried via the Hive connector.","commonSituations":"External pipelines (Spark/Hive jobs) writing ORC files with UNION columns that Presto tables then reference; schema drift where a column type changed in the writer but the Presto table still points at it.","solutions":["Remove or transform the unsupported column (e.g. UNION) in the upstream writer — explode UNION to a concrete type.","Rewrite the ORC file with only supported types (struct/map/array/primitives).","Upgrade Presto, as newer versions add support for more ORC types.","Change the Hive table schema to exclude the unsupported column before querying."],"exampleFix":"// before (writer side)\nstruct<id:int, payload:uniontype<int,string>>\n// after\nstruct<id:int, payload:string>  -- normalize UNION to a concrete type before writing ORC","handlingStrategy":"validation","validationCode":"// before querying, confirm no unsupported ORC types (e.g. UNION) in schema\n// orc-tools meta file.orc | grep -i union","typeGuard":"boolean isSupportedOrcType(TypeKind kind) { return kind != TypeKind.UNION; }","tryCatchPattern":"try { reader = BatchStreamReaders.createStreamReader(...); } catch (IllegalArgumentException e) { throw new TableReadException(\"unsupported column type\", e); }","preventionTips":["Avoid UNION columns in ORC files read by Presto","Keep writer and reader versions aligned","Audit table schemas after upstream pipeline changes"],"tags":["orc","unsupported-type","schema","presto"],"backgroundTag":"unsupported-orc-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"}