{"record":{"id":"e1f4596122388701","repo":"apache/flink","slug":"unsupported-type-e1f459","errorCode":null,"errorMessage":"Unsupported type: {}","messagePattern":"Unsupported type: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/utils/ParquetSchemaConverter.java","lineNumber":178,"sourceCode":"            case MULTISET:\n                MultisetType multisetType = (MultisetType) type;\n                LogicalType elementType = multisetType.getElementType();\n                if (elementType.isNullable()) {\n                    // element type is nullable, but Parquet does not support nullable map keys,\n                    // so we configure it as not nullable\n                    elementType = elementType.copy(false);\n                }\n                return ConversionPatterns.mapType(\n                        repetition,\n                        name,\n                        MAP_REPEATED_NAME,\n                        convertToParquetType(\"key\", elementType, conf),\n                        convertToParquetType(\"value\", new IntType(false), conf));\n            case ROW:\n                RowType rowType = (RowType) type;\n                return new GroupType(repetition, name, convertToParquetTypes(rowType, conf));\n            default:\n                throw new UnsupportedOperationException(\"Unsupported type: \" + type);\n        }\n    }\n\n    private static List<Type> convertToParquetTypes(RowType rowType, Configuration conf) {\n        List<Type> types = new ArrayList<>(rowType.getFieldCount());\n        for (int i = 0; i < rowType.getFieldCount(); i++) {\n            types.add(\n                    convertToParquetType(\n                            rowType.getFieldNames().get(i), rowType.getTypeAt(i), conf));\n        }\n        return types;\n    }\n\n    public static int computeMinBytesForDecimalPrecision(int precision) {\n        int numBytes = 1;\n        while (Math.pow(2.0, 8 * numBytes - 1) < Math.pow(10.0, precision)) {\n            numBytes += 1;\n        }","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/utils/ParquetSchemaConverter.java#L160-L196","documentation":"ParquetSchemaConverter.convertToParquetType maps each Flink LogicalTypeRoot to a parquet type; the switch's default throws UnsupportedOperationException('Unsupported type: ' + type) for any root kind without a mapping (the handled set covers primitives, decimal, date/time/timestamps, string/binary/char variants, array, map, multiset, row).","triggerScenarios":"Calling the converter with a LogicalType whose root is unhandled - e.g. DISTINCT, STRUCTURED, SYMBOL, RAW, UNRESOLVED, or INTERVAL types.","commonSituations":"Table schemas containing RAW columns (e.g. from DataStream-to-Table conversion), DISTINCT types from custom catalogs, or unresolved types reaching the parquet sink during schema derivation.","solutions":["Remove or transform the unsupported column before writing: cast to a supported type or drop it","For RAW columns, register a proper serializer-based sink or convert the payload to BYTES/STRING","Check the exact type printed in the message to identify which column of your schema is the offender"],"exampleFix":"-- before\ntypeName RAW('java.lang.Class', ...)\n\n-- after\ntypeName BYTES  -- serialize the raw payload yourself, or drop the column","handlingStrategy":"validation","validationCode":"static final Set<LogicalTypeRoot> UNSUPPORTED = EnumSet.of(RAW, DISTINCT, SYMBOL, STRUCTURED, UNRESOLVED);\nfor (int i = 0; i < rowType.getFieldCount(); i++) {\n  if (UNSUPPORTED.contains(rowType.getTypeAt(i).getTypeRoot())) throw new IllegalArgumentException(\"column '\" + rowType.getFieldNames().get(i) + \"' has unsupported type for parquet\");\n}","typeGuard":null,"tryCatchPattern":"try { schema = ParquetSchemaConverter.convertToParquetType(...); } catch (UnsupportedOperationException e) { // e.getMessage() names the type: drop/cast that column and rebuild }","preventionTips":["Exclude RAW/DISTINCT/STRUCTURED/SYMBOL columns from parquet sinks","Convert opaque payloads to BYTES or STRING before writing","Validate the full RowType against supported roots at sink open time"],"tags":["parquet","schema-conversion","unsupported-type","flink-sql"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}