Skip to content

Commit

Permalink
Revert "Revert "Double deserialization""
Browse files Browse the repository at this point in the history
This reverts commit 213f47a.
  • Loading branch information
girarda committed Feb 23, 2022
1 parent 8e6b34e commit 6682245
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 6682245

Please sign in to comment.