Skip to content

Commit 55fb0ca

Browse files
more test
1 parent 5976fbc commit 55fb0ca

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/rules/physical/local/ReplaceRoundToWithQueryAndTagsTests.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ public ReplaceRoundToWithQueryAndTagsTests(String name, Configuration config) {
9090
private static final Map<String, QueryBuilder> otherPushDownFunctions = new HashMap<>(
9191
Map.ofEntries(
9292
Map.entry("keyword == \"keyword\"", termQuery("keyword", "keyword").boost(0)),
93+
Map.entry(
94+
"keyword >= \"2023-10-19\" and keyword <= \"2023-10-24\"",
95+
rangeQuery("keyword").gte("2023-10-19").lte("2023-10-24").timeZone("Z").boost(0)
96+
),
9397
Map.entry("keyword : \"keyword\"", matchQuery("keyword", "keyword").lenient(true))
9498
)
9599
);
@@ -231,7 +235,12 @@ public void testDateTruncBucketTransformToQueryAndTagsWithOtherPushdownFunctions
231235
""", predicate, dateHistogram);
232236
QueryBuilder mainQueryBuilder = qb instanceof MatchQueryBuilder
233237
? qb
234-
: wrapWithSingleQuery(query, qb, "keyword", new Source(2, 8, predicate));
238+
: wrapWithSingleQuery(
239+
query,
240+
qb,
241+
"keyword",
242+
new Source(2, 8, predicate.contains("and") ? predicate.substring(0, 23) : predicate)
243+
);
235244

236245
PhysicalPlan plan = plannerOptimizer.plan(query, searchStats, makeAnalyzer("mapping-all-types.json"));
237246

0 commit comments

Comments
 (0)