apache/beam · error · UnsupportedRowJsonException

Unable to parse Row

Error message

Unable to parse Row

What it means

RowJsonUtils.jsonToRow wraps Jackson's JsonParseException/JsonMappingException (both IOException subclasses handled first) into UnsupportedRowJsonException('Unable to parse Row'). It means the JSON string is malformed or violates the Row schema mapping, and the underlying Jackson exception carries the detail.

Source

Thrown at sdks/java/core/src/main/java/org/apache/beam/sdk/util/RowJsonUtils.java:138

    return objectMapper;
  }

  public static ObjectMapper newObjectMapperWith(RowJson.RowJsonSerializer serializer) {
    SimpleModule module = new SimpleModule("rowSerializationModule");
    module.addSerializer(Row.class, serializer);

    ObjectMapper objectMapper = new ObjectMapper(createJsonFactory(MAX_STRING_LENGTH));
    objectMapper.registerModule(module);

    return objectMapper;
  }

  public static Row jsonToRow(ObjectMapper objectMapper, String jsonString) {
    try {
      return objectMapper.readValue(jsonString, Row.class);
    } catch (JsonParseException | JsonMappingException jsonException) {
      throw new UnsupportedRowJsonException("Unable to parse Row", jsonException);
    } catch (IOException e) {
      throw new IllegalArgumentException("Unable to parse json object: " + jsonString, e);
    }
  }

  public static String rowToJson(ObjectMapper objectMapper, Row row) {
    try {
      return objectMapper.writeValueAsString(row);
    } catch (JsonProcessingException e) {
      throw new IllegalArgumentException("Unable to serialize row: " + row, e);
    }
  }
}

View on GitHub (pinned to 12126d8942)

Solutions

  1. Inspect the cause (getCause()) for the precise Jackson/RowJson error
  2. Validate/pretty-print the JSON string to confirm syntactic validity
  3. Verify the ObjectMapper is configured with the RowJson module/creator for Row
  4. Fix the payload per the underlying cause; catch UnsupportedRowJsonException for graceful handling

Example fix

try {
  Row row = RowJsonUtils.jsonToRow(mapper, json);
} catch (RowJson.UnsupportedRowJsonException e) {
  LOG.error("Row parse failed: {}", e.getCause(), e);
}
Defensive patterns

Strategy: try-catch

Validate before calling

try { new ObjectMapper().readTree(jsonString); } catch (IOException e) { throw new IllegalArgumentException("Invalid JSON", e); }

Try / catch

try { Row r = RowJsonUtils.jsonToRow(mapper, json); } catch (RowJson.UnsupportedRowJsonException e) { JsonProcessingException cause = (JsonProcessingException) e.getCause(); /* inspect cause location/detail */ }

Prevention

When it happens

Trigger: Calling jsonToRow(objectMapper, jsonString) with syntactically invalid JSON, or JSON that fails Row deserialization (schema violations like missing fields, wrong types), including errors 710-715 bubbling up through Jackson.

Common situations: Truncated/corrupted payloads from queues or files; wrong content type feeding JSON parsing; schema/JSON drift; nested UnsupportedRowJsonException surfaced with this generic wrapper.

Understand the failure class

Background: JSON parse error: "Unexpected token" / "not valid JSON" / "failed to parse" — what JSON parsers are really complaining about — this error's family across 45 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/9c5bddbd09c311ef. Report an issue: GitHub.