Skip to content

Commit

Permalink
Double deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
girarda committed Feb 23, 2022
1 parent edae0a6 commit ee8d752
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,19 @@ protected List<JsonNode> retrieveRecords(final TestDestinationEnv env,
final String namespace,
final JsonNode streamSchema)
throws Exception {
return retrieveRecordsFromTable(namingResolver.getRawTableName(streamName), namespace)
final List<JsonNode> records = retrieveRecordsFromTable(namingResolver.getRawTableName(streamName), namespace);
return records
.stream()
.map(j -> Jsons.deserialize(j.get(JavaBaseConstants.COLUMN_NAME_DATA).asText()))
.map(j -> {
final String text = j.get(JavaBaseConstants.COLUMN_NAME_DATA).asText();
final JsonNode deserialized = Jsons.deserialize(text);
if (deserialized.isTextual()) {
final JsonNode d = Jsons.deserialize(deserialized.asText());
return d;
} else {
return deserialized;
}
})
.collect(Collectors.toList());
}

Expand Down

0 comments on commit ee8d752

Please sign in to comment.