apache/flink · error · UnsupportedOperationException

Unsupported type: {}

Error message

Unsupported type: {}

What it means

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).

Source

Thrown at flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/utils/ParquetSchemaConverter.java:178

            case MULTISET:
                MultisetType multisetType = (MultisetType) type;
                LogicalType elementType = multisetType.getElementType();
                if (elementType.isNullable()) {
                    // element type is nullable, but Parquet does not support nullable map keys,
                    // so we configure it as not nullable
                    elementType = elementType.copy(false);
                }
                return ConversionPatterns.mapType(
                        repetition,
                        name,
                        MAP_REPEATED_NAME,
                        convertToParquetType("key", elementType, conf),
                        convertToParquetType("value", new IntType(false), conf));
            case ROW:
                RowType rowType = (RowType) type;
                return new GroupType(repetition, name, convertToParquetTypes(rowType, conf));
            default:
                throw new UnsupportedOperationException("Unsupported type: " + type);
        }
    }

    private static List<Type> convertToParquetTypes(RowType rowType, Configuration conf) {
        List<Type> types = new ArrayList<>(rowType.getFieldCount());
        for (int i = 0; i < rowType.getFieldCount(); i++) {
            types.add(
                    convertToParquetType(
                            rowType.getFieldNames().get(i), rowType.getTypeAt(i), conf));
        }
        return types;
    }

    public static int computeMinBytesForDecimalPrecision(int precision) {
        int numBytes = 1;
        while (Math.pow(2.0, 8 * numBytes - 1) < Math.pow(10.0, precision)) {
            numBytes += 1;
        }

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Remove or transform the unsupported column before writing: cast to a supported type or drop it
  2. For RAW columns, register a proper serializer-based sink or convert the payload to BYTES/STRING
  3. Check the exact type printed in the message to identify which column of your schema is the offender

Example fix

-- before
typeName RAW('java.lang.Class', ...)

-- after
typeName BYTES  -- serialize the raw payload yourself, or drop the column
Defensive patterns

Strategy: validation

Validate before calling

static final Set<LogicalTypeRoot> UNSUPPORTED = EnumSet.of(RAW, DISTINCT, SYMBOL, STRUCTURED, UNRESOLVED);
for (int i = 0; i < rowType.getFieldCount(); i++) {
  if (UNSUPPORTED.contains(rowType.getTypeAt(i).getTypeRoot())) throw new IllegalArgumentException("column '" + rowType.getFieldNames().get(i) + "' has unsupported type for parquet");
}

Try / catch

try { schema = ParquetSchemaConverter.convertToParquetType(...); } catch (UnsupportedOperationException e) { // e.getMessage() names the type: drop/cast that column and rebuild }

Prevention

When it happens

Trigger: Calling the converter with a LogicalType whose root is unhandled - e.g. DISTINCT, STRUCTURED, SYMBOL, RAW, UNRESOLVED, or INTERVAL types.

Common situations: 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.

Related errors


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/e1f4596122388701. Report an issue: GitHub.