Skip to content

Commit

Permalink
use JsonUtils instead of objectMapper to read lineage search response
Browse files Browse the repository at this point in the history
  • Loading branch information
sonika-shah committed Nov 15, 2024
1 parent 6bbeb91 commit 10d37ff
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import static org.openmetadata.service.search.SearchClient.REMOVE_LINEAGE_SCRIPT;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.opencsv.CSVWriter;
import java.io.IOException;
import java.io.StringWriter;
Expand Down Expand Up @@ -272,8 +271,8 @@ public final String exportCsvAsync(
.searchLineage(fqn, upstreamDepth, downstreamDepth, queryFilter, deleted, entityType);

try {
ObjectMapper objectMapper = new ObjectMapper();
JsonNode rootNode = objectMapper.readTree(response.getEntity().toString());
String jsonResponse = JsonUtils.pojoToJson(response.getEntity());
JsonNode rootNode = JsonUtils.readTree(jsonResponse);

Map<String, JsonNode> entityMap = new HashMap<>();
JsonNode nodes = rootNode.path("nodes");
Expand Down

0 comments on commit 10d37ff

Please sign in to comment.