@@ -87,12 +87,22 @@ public void testCanMatch() {
8787 assertThat (queriedIndices , equalTo (Set .of ("events_2023" )));
8888 queriedIndices .clear ();
8989 }
90+ try (EsqlQueryResponse resp = run ("from events_* | WHERE @timestamp >= date_parse(\" yyyy-MM-dd\" , \" 2023-01-01\" )" )) {
91+ assertThat (getValuesList (resp ), hasSize (4 ));
92+ assertThat (queriedIndices , equalTo (Set .of ("events_2023" )));
93+ queriedIndices .clear ();
94+ }
9095
9196 try (EsqlQueryResponse resp = run ("from events_*" , randomPragmas (), new RangeQueryBuilder ("@timestamp" ).lt ("2023-01-01" ))) {
9297 assertThat (getValuesList (resp ), hasSize (3 ));
9398 assertThat (queriedIndices , equalTo (Set .of ("events_2022" )));
9499 queriedIndices .clear ();
95100 }
101+ try (EsqlQueryResponse resp = run ("from events_* | WHERE @timestamp < date_parse(\" yyyy-MM-dd\" , \" 2023-01-01\" )" )) {
102+ assertThat (getValuesList (resp ), hasSize (3 ));
103+ assertThat (queriedIndices , equalTo (Set .of ("events_2022" )));
104+ queriedIndices .clear ();
105+ }
96106
97107 try (
98108 EsqlQueryResponse resp = run (
@@ -105,6 +115,17 @@ public void testCanMatch() {
105115 assertThat (queriedIndices , equalTo (Set .of ("events_2022" , "events_2023" )));
106116 queriedIndices .clear ();
107117 }
118+ try (
119+ EsqlQueryResponse resp = run (
120+ "from events_* "
121+ + "| WHERE @timestamp > date_parse(\" yyyy-MM-dd\" , \" 2022-01-01\" ) "
122+ + "AND @timestamp < date_parse(\" yyyy-MM-dd\" , \" 2023-12-31\" )"
123+ )
124+ ) {
125+ assertThat (getValuesList (resp ), hasSize (7 ));
126+ assertThat (queriedIndices , equalTo (Set .of ("events_2022" , "events_2023" )));
127+ queriedIndices .clear ();
128+ }
108129
109130 try (
110131 EsqlQueryResponse resp = run (
@@ -117,6 +138,17 @@ public void testCanMatch() {
117138 assertThat (queriedIndices , empty ());
118139 queriedIndices .clear ();
119140 }
141+ try (
142+ EsqlQueryResponse resp = run (
143+ "from events_* "
144+ + "| WHERE @timestamp > date_parse(\" yyyy-MM-dd\" , \" 2023-01-01\" ) "
145+ + "AND @timestamp < date_parse(\" yyyy-MM-dd\" , \" 2023-01-01\" )"
146+ )
147+ ) {
148+ assertThat (getValuesList (resp ), hasSize (0 ));
149+ assertThat (queriedIndices , empty ());
150+ queriedIndices .clear ();
151+ }
120152 } finally {
121153 for (TransportService transportService : internalCluster ().getInstances (TransportService .class )) {
122154 as (transportService , MockTransportService .class ).clearAllRules ();
0 commit comments