Skip to content

Commit

Permalink
Merge incorrectly split strings
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNeuralBit committed Oct 25, 2019
1 parent 6f9e11a commit 0cf8ae8
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions sdks/java/core/src/main/java/org/apache/beam/sdk/util/RowJson.java
Expand Up @@ -145,12 +145,9 @@ private static Row jsonObjectToRow(FieldValue rowFieldValue) {
throw new UnsupportedRowJsonException(
"Expected JSON object for field '"
+ rowFieldValue.name()
+ "'. "
+ "Unable to convert '"
+ "'. Unable to convert '"
+ rowFieldValue.jsonValue().asText()
+ "'"
+ " to Beam Row, it is not a JSON object. Currently only JSON objects "
+ "can be parsed to Beam Rows");
+ "' to Beam Row, it is not a JSON object. Currently only JSON objects can be parsed to Beam Rows");
}

return rowFieldValue.rowSchema().getFields().stream()
Expand All @@ -169,8 +166,7 @@ private static Object jsonArrayToList(FieldValue arrayFieldValue) {
throw new UnsupportedRowJsonException(
"Expected JSON array for field '"
+ arrayFieldValue.name()
+ "'. "
+ "Instead got "
+ "'. Instead got "
+ arrayFieldValue.jsonNodeType().name());
}

Expand All @@ -193,11 +189,9 @@ private static Object extractJsonPrimitiveValue(FieldValue fieldValue) {
throw new UnsupportedRowJsonException(
"Unable to get value from field '"
+ fieldValue.name()
+ "'. "
+ "Schema type '"
+ "'. Schema type '"
+ fieldValue.typeName()
+ "'. "
+ "JSON node type "
+ "'. JSON node type "
+ fieldValue.jsonNodeType().name(),
e);
}
Expand Down

0 comments on commit 0cf8ae8

Please sign in to comment.