@@ -219,6 +219,25 @@ public void notLikeTest() throws IOException, SqlParseException, SQLFeatureNotSu
219
219
}
220
220
}
221
221
222
+ @ Test
223
+ public void doubleNotTest () throws IOException , SqlParseException , SQLFeatureNotSupportedException {
224
+ SearchHits response1 = query (String .format ("SELECT * FROM %s/account WHERE not gender like 'm' and not gender like 'f'" , TEST_INDEX ));
225
+ Assert .assertEquals (0 , response1 .getTotalHits ());
226
+
227
+ SearchHits response2 = query (String .format ("SELECT * FROM %s/account WHERE not gender like 'm' and gender not like 'f'" , TEST_INDEX ));
228
+ Assert .assertEquals (0 , response2 .getTotalHits ());
229
+
230
+ SearchHits response3 = query (String .format ("SELECT * FROM %s/account WHERE gender not like 'm' and gender not like 'f'" , TEST_INDEX ));
231
+ Assert .assertEquals (0 , response3 .getTotalHits ());
232
+
233
+ SearchHits response4 = query (String .format ("SELECT * FROM %s/account WHERE gender like 'm' and not gender like 'f'" , TEST_INDEX ));
234
+ // assert there are results and they all have gender 'm'
235
+ Assert .assertNotEquals (0 , response4 .getTotalHits ());
236
+ for (SearchHit hit : response4 .getHits ()) {
237
+ Assert .assertEquals ("m" , hit .getSource ().get ("gender" ).toString ().toLowerCase ());
238
+ }
239
+ }
240
+
222
241
@ Test
223
242
public void limitTest () throws IOException , SqlParseException , SQLFeatureNotSupportedException {
224
243
SearchHits response = query (String .format ("SELECT * FROM %s LIMIT 30" , TEST_INDEX ));
@@ -346,8 +365,8 @@ public void notInTest() throws IOException, SqlParseException, SQLFeatureNotSupp
346
365
}
347
366
}
348
367
}
349
-
350
-
368
+
369
+
351
370
@ Test
352
371
public void dateSearch () throws IOException , SqlParseException , SQLFeatureNotSupportedException , ParseException {
353
372
DateTimeFormatter formatter = DateTimeFormat .forPattern (DATE_FORMAT );
@@ -429,7 +448,7 @@ public void notMissFilterSearch() throws IOException, SqlParseException, SQLFeat
429
448
assertThat (hit .getSource (), hasKey ("insert_time" ));
430
449
}
431
450
}
432
-
451
+
433
452
434
453
435
454
@ Test
0 commit comments