{"record":{"id":"9d7a5f7a1db332a7","repo":"prestodb/presto","slug":"unsupported-fieldvector-type-fieldvector-getclas","errorCode":null,"errorMessage":"Unsupported FieldVector type: {fieldVector.getClass()}","messagePattern":"Unsupported FieldVector type: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-common-arrow/src/main/java/com/facebook/plugin/arrow/ArrowBlockBuilder.java","lineNumber":227,"sourceCode":"            SmallIntVector smallIntIndicesVector = (SmallIntVector) fieldVector;\n            int[] ids = new int[smallIntIndicesVector.getValueCount()];\n            for (int i = 0; i < smallIntIndicesVector.getValueCount(); i++) {\n                ids[i] = smallIntIndicesVector.get(i);\n            }\n            return new DictionaryBlock(ids.length, dictionaryblock, ids);\n        }\n        else if (fieldVector instanceof TinyIntVector) {\n            // Get the TinyInt indices vector\n            TinyIntVector tinyIntIndicesVector = (TinyIntVector) fieldVector;\n            int[] ids = new int[tinyIntIndicesVector.getValueCount()];\n            for (int i = 0; i < tinyIntIndicesVector.getValueCount(); i++) {\n                ids[i] = tinyIntIndicesVector.get(i);\n            }\n            return new DictionaryBlock(ids.length, dictionaryblock, ids);\n        }\n        else {\n            // Handle the case where the FieldVector is of an unsupported type\n            throw new IllegalArgumentException(\"Unsupported FieldVector type: \" + fieldVector.getClass());\n        }\n    }\n\n    private void assignBlockFromValueVector(ValueVector vector, Type type, BlockBuilder builder, int startIndex, int endIndex)\n    {\n        if (vector instanceof BitVector) {\n            assignBlockFromBitVector((BitVector) vector, type, builder, startIndex, endIndex);\n        }\n        else if (vector instanceof TinyIntVector) {\n            assignBlockFromTinyIntVector((TinyIntVector) vector, type, builder, startIndex, endIndex);\n        }\n        else if (vector instanceof IntVector) {\n            assignBlockFromIntVector((IntVector) vector, type, builder, startIndex, endIndex);\n        }\n        else if (vector instanceof SmallIntVector) {\n            assignBlockFromSmallIntVector((SmallIntVector) vector, type, builder, startIndex, endIndex);\n        }\n        else if (vector instanceof BigIntVector) {","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-common-arrow/src/main/java/com/facebook/plugin/arrow/ArrowBlockBuilder.java#L209-L245","documentation":"ArrowBlockBuilder.buildDictionaryBlock encounters a FieldVector whose Arrow type it cannot convert to a Presto DictionaryBlock. The builder dispatches on known Arrow vector classes (Bit, Int, BigInt, VarChar, etc.) and throws IllegalArgumentException with the vector's Java class when no branch matches. It signals an Arrow column type this connector does not map to any Presto type.","triggerScenarios":"Calling buildBlockFromFieldVector with a FieldVector whose concrete class (e.g. TimeMicroVector, DurationVector, Interval vector, or a newer Arrow vector type) has no instanceof branch in buildDictionaryBlock, so control reaches the final else.","commonSituations":"Reading Arrow/Flight data produced by a newer Arrow writer with vector types the connector predates; schema drift upstream adds a column of an unmapped type; using an Arrow extension type that materializes as an unhandled vector class.","solutions":["Check the thrown class name and confirm whether a mapping exists for that Arrow type in ArrowBlockBuilder","Convert/omit the unmapped column before it reaches the connector, or cast it to a supported Arrow type on the producer side","Add an instanceof branch plus an assignBlockFrom* method for the new vector type in ArrowBlockBuilder","Upgrade the connector/Arrow plugin version that may already support the vector type"],"exampleFix":"// before: unmapped TimeMicroVector falls through to the throw\n// after: add a branch before the else\nif (fieldVector instanceof TimeMicroVector) {\n    return buildTimestampBlock((TimeMicroVector) fieldVector, type);\n}","handlingStrategy":"type-guard","validationCode":"// before calling the connector's block building\nif (!(fieldVector instanceof BitVector || fieldVector instanceof IntVector\n        || fieldVector instanceof BigIntVector || fieldVector instanceof VarCharVector\n        || fieldVector instanceof DecimalVector || fieldVector instanceof ListVector\n        || fieldVector instanceof StructVector || fieldVector instanceof MapVector)) {\n    throw new IllegalStateException(\"Unmapped Arrow vector type: \" + fieldVector.getClass().getName());\n}","typeGuard":"boolean isSupportedArrowVector(ValueVector v) {\n    return v instanceof BitVector || v instanceof TinyIntVector || v instanceof IntVector\n        || v instanceof BigIntVector || v instanceof Float4Vector || v instanceof Float8Vector\n        || v instanceof DecimalVector || v instanceof VarCharVector || v instanceof DateDayVector\n        || v instanceof DateMilliVector || v instanceof TimeSecVector || v instanceof TimeMilliVector\n        || v instanceof TimeStampMicroVector || v instanceof TimeStampMilliVector\n        || v instanceof ListVector || v instanceof FixedSizeListVector\n        || v instanceof StructVector || v instanceof MapVector;\n}","tryCatchPattern":"try {\n    Block block = blockBuilder.buildBlockFromFieldVector(fieldVector, type);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unsupported FieldVector type\")) {\n        LOG.warn(\"Skipping unmapped Arrow column: %s (%s)\", fieldVector.getName(), fieldVector.getClass());\n        return null; // or fall back to a VARCHAR-serialized block\n    }\n    throw e;\n}","preventionTips":["Compare the Arrow schema against the connector's supported type list before executing a query","Pin Arrow producer and connector versions; test schema compatibility on upgrades","Serialize unknown/extension types to a supported type (e.g. varchar JSON) at the producer","Add an integration test per Arrow column type in your dataset"],"tags":["arrow","java","unsupported-type","illegal-argument"],"backgroundTag":"unsupported-arrow-vector-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"}