apache/flink · error · java.lang.UnsupportedOperationException

Unsupported type: {}

Error message

Unsupported type: {}

What it means

UnsupportedOperationException from JsonParserToRowDataConverters.createConverter when the row type contains a logical type it cannot convert — the explicit case is RAW, and the default branch catches anything else the switch does not handle. It means the declared schema for the JSON source contains a type the streaming parser cannot map from JSON text.

Source

Thrown at flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/JsonParserToRowDataConverters.java:192

            case DECIMAL:
                return createDecimalConverter((DecimalType) type);
            case ARRAY:
                return createArrayConverter((ArrayType) type);
            case MAP:
                MapType mapType = (MapType) type;
                return createMapConverter(
                        mapType.asSummaryString(), mapType.getKeyType(), mapType.getValueType());
            case MULTISET:
                MultisetType multisetType = (MultisetType) type;
                return createMapConverter(
                        multisetType.asSummaryString(),
                        multisetType.getElementType(),
                        new IntType());
            case ROW:
                return createRowConverter((RowType) type);
            case RAW:
            default:
                throw new UnsupportedOperationException("Unsupported type: " + type);
        }
    }

    private boolean convertToBoolean(JsonParser jp) throws IOException {
        if (jp.currentToken() == JsonToken.VALUE_TRUE) {
            return true;
        } else if (jp.currentToken() == JsonToken.VALUE_FALSE) {
            return false;
        } else {
            return Boolean.parseBoolean(jp.getText().trim());
        }
    }

    private byte convertToByte(JsonParser jp) throws IOException {
        if (jp.currentToken() == JsonToken.VALUE_NUMBER_INT) {
            // DON'T use jp.getByteValue() whose value is from -128 to 255 because of the unsigned
            // value.
            int value = jp.getIntValue();

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Replace RAW columns with JSON-representable types (STRING, BYTES where supported, or flatten the structure)
  2. For POJO fields, annotate/convert them to explicit SQL types in the DDL instead of schema derivation
  3. Project the problematic column out (do not select/ingest it) if it is not needed

Example fix

-- before
cfg AS RAW

-- after
cfg AS STRING
Defensive patterns

Strategy: validation

Validate before calling

boolean hasUnsupported = LogicalTypeChecks.hasNested(
    rowType, t -> t instanceof RawType);
if (hasUnsupported) throw new UnsupportedOperationException("JSON cannot carry RAW columns");

Prevention

When it happens

Trigger: Defining a JSON table with a RAW-typed column (e.g., a TypeInformation-picked POJO/byte[] fallback), or an exotic/nested type that reaches the default branch of the converter switch.

Common situations: Schema derived automatically from a POJO where one field serialized as RAW; hand-written DDL using a type JSON cannot represent; using the json parser schema (JsonParserRowDataDeserializationSchema) where the classic Jackson-based schema would behave differently.

Related errors


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