Skip to content

Commit

Permalink
Fixed unit test for OpenSearchNodeClientTest.search()
Browse files Browse the repository at this point in the history
Signed-off-by: Guian Gumpac <[email protected]>
  • Loading branch information
GumpacG authored and forestmvey committed Feb 22, 2023
1 parent 1817486 commit 473bb85
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,13 @@ public Iterator<ExprValue> iterator() {
return Arrays.stream(hits.getHits())
.map(hit -> {
ExprValue docData = exprValueFactory.construct(hit.getSourceAsString());
Map<String, Object> rowSource = hit.getSourceAsMap();
// TODO Move flattening logic to UnnestOperator
// List<String> head = docData.tupleValue().keySet().stream().collect(Collectors.toList());
// Set<String> newKeys = new HashSet<>(head);
// rowSource = flatRow(head, rowSource);
// rowSource = flatNestedField(newKeys, rowSource, hit.getInnerHits());
docData = ExprValueUtils.tupleValue(rowSource);
if (hit.getHighlightFields().isEmpty()) {
return docData;
if (hit.getInnerHits().isEmpty()) {
return docData;
} else {
Map<String, Object> rowSource = hit.getSourceAsMap();
return ExprValueUtils.tupleValue(rowSource);
}
} else {
ImmutableMap.Builder<String, ExprValue> builder = new ImmutableMap.Builder<>();
builder.putAll(docData.tupleValue());
Expand Down

0 comments on commit 473bb85

Please sign in to comment.