Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -442,21 +442,14 @@ public void testLengthPushedWithTopN() throws IOException {
matchesList().item(matchesMap().entry("name", "test").entry("type", any(String.class))),
Map.of(
"data",
Build.current().isSnapshot()
? List.of(matchesMap().entry("ordering:column_at_a_time:IntsFromDocValues.Singleton", 1))
: List.of(
matchesMap().entry("ordering:column_at_a_time:IntsFromDocValues.Singleton", 1)
.entry("test:column_at_a_time:BytesRefsFromOrds.Singleton", 1)
),
List.of(matchesMap().entry("ordering:column_at_a_time:IntsFromDocValues.Singleton", 1)),
"node_reduce",
Build.current().isSnapshot()
? List.of(
// Pushed down function
matchesMap().entry("test:column_at_a_time:Utf8CodePointsFromOrds.Singleton", 1),
// Field
matchesMap().entry("test:column_at_a_time:BytesRefsFromOrds.Singleton", 1)
)
: List.of(matchesMap().entry("test:row_stride:BytesRefsFromOrds.Singleton", 1))
List.of(
// Pushed down function
matchesMap().entry("test:column_at_a_time:Utf8CodePointsFromOrds.Singleton", 1),
// Field
matchesMap().entry("test:column_at_a_time:BytesRefsFromOrds.Singleton", 1)
)
),
sig -> assertMap(
sig,
Expand Down Expand Up @@ -514,25 +507,20 @@ public void testLengthPushedWithTopNAsOrder() throws IOException {
*/
public void testLengthNotPushedToLookupJoinKeyword() throws IOException {
initLookupIndex();
test(
b -> b.startObject("main_matching").field("type", "keyword").endObject(),
b -> b.field("main_matching", "lookup"),
"""
| LOOKUP JOIN lookup ON matching == main_matching
| EVAL test = LENGTH(test)
""",
matchesList().item(1),
matchesMap().entry("main_matching:column_at_a_time:BytesRefsFromOrds.Singleton", 1),
sig -> assertMap(
test(b -> b.startObject("main_matching").field("type", "keyword").endObject(), b -> b.field("main_matching", "lookup"), """
| LOOKUP JOIN lookup ON matching == main_matching
| EVAL test = LENGTH(test)
""", matchesList().item(1), matchesMap().entry("main_matching:column_at_a_time:BytesRefsFromOrds.Singleton", 1), sig -> {
assertMap(
sig,
matchesList().item("LuceneSourceOperator")
.item("ValuesSourceReaderOperator") // the real work is here, checkOperatorProfile checks the status
.item("StreamingLookupOperator")
.item(lookupOperatorName())
.item("EvalOperator") // this one just renames the field
.item("AggregationOperator")
.item("ExchangeSinkOperator")
)
);
);
});
}

/**
Expand All @@ -546,25 +534,21 @@ public void testLengthNotPushedToLookupJoinKeywordSameName() throws IOException
test(b -> {
b.startObject("test").field("type", "keyword").endObject();
b.startObject("main_matching").field("type", "keyword").endObject();
},
b -> b.field("test", value).field("main_matching", "lookup"),
"""
| DROP test
| LOOKUP JOIN lookup ON matching == main_matching
| EVAL test = LENGTH(test)
""",
matchesList().item(1),
matchesMap().entry("main_matching:column_at_a_time:BytesRefsFromOrds.Singleton", 1),
sig -> assertMap(
}, b -> b.field("test", value).field("main_matching", "lookup"), """
| DROP test
| LOOKUP JOIN lookup ON matching == main_matching
| EVAL test = LENGTH(test)
""", matchesList().item(1), matchesMap().entry("main_matching:column_at_a_time:BytesRefsFromOrds.Singleton", 1), sig -> {
assertMap(
sig,
matchesList().item("LuceneSourceOperator")
.item("ValuesSourceReaderOperator") // the real work is here, checkOperatorProfile checks the status
.item("StreamingLookupOperator")
.item(lookupOperatorName())
.item("EvalOperator") // this one just renames the field
.item("AggregationOperator")
.item("ExchangeSinkOperator")
)
);
);
});
}

/**
Expand Down Expand Up @@ -948,6 +932,10 @@ private void initLookupIndex() throws IOException {
assertThat(entityToMap(bulkResponse.getEntity(), XContentType.JSON), matchesMap().entry("errors", false).extraOk());
}

private static String lookupOperatorName() {
return Build.current().isSnapshot() ? "StreamingLookupOperator" : "LookupOperator";
}

private CheckedConsumer<XContentBuilder, IOException> justType(String type) {
return justType("test", type);
}
Expand Down
Loading