@@ -1161,15 +1161,20 @@ public void testLogicalAndComparisonOperators() throws Exception {
11611161 .pipeline ()
11621162 .createFrom (collection )
11631163 .where (
1164- Expression .notEqualAny ("genre" , Lists .newArrayList ("Romance" , "Dystopian" , null )))
1164+ Expression .notEqualAny (
1165+ "genre" , Lists .newArrayList ("Science Fiction" , "Romance" , "Dystopian" , null )))
11651166 .select ("genre" )
11661167 .distinct ("genre" )
11671168 .execute ()
11681169 .get ()
11691170 .getResults ();
11701171 assertThat (data (results ))
11711172 .containsExactly (
1172- map ("genre" , "Science Fiction" ),
1173+ // This is somewhat surprising because the pipeline did ask specifically for genre not
1174+ // equal to null,
1175+ // however at the later distinct stage, UNSET is grouped as null and thus null appears
1176+ // in the result.
1177+ map ("genre" , null ),
11731178 map ("genre" , "Magical Realism" ),
11741179 map ("genre" , "Fantasy" ),
11751180 map ("genre" , "Psychological Thriller" ),
@@ -1236,10 +1241,9 @@ public void testChecks() throws Exception {
12361241 .select (
12371242 field ("rating" ).equal (nullValue ()).as ("ratingIsNull" ),
12381243 field ("rating" ).equal (Double .NaN ).as ("ratingIsNaN" ),
1244+ // arrayGet("title", 0) evaluates to UNSET
12391245 arrayGet ("title" , 0 ).isError ().as ("isError" ),
1240- arrayGet ("title" , 0 )
1241- .ifError (constant ("was error" ), constant ("was not error" ))
1242- .as ("ifError" ),
1246+ arrayGet ("title" , 0 ).ifError (constant ("was error" )).as ("ifError" ),
12431247 field ("foo" ).isAbsent ().as ("isAbsent" ),
12441248 field ("title" ).notEqual (nullValue ()).as ("titleIsNotNull" ),
12451249 field ("cost" ).notEqual (Double .NaN ).as ("costIsNotNan" ),
@@ -1259,8 +1263,6 @@ public void testChecks() throws Exception {
12591263 false ,
12601264 "isError" ,
12611265 false ,
1262- "ifError" ,
1263- "was not error" ,
12641266 "isAbsent" ,
12651267 true ,
12661268 "titleIsNotNull" ,
0 commit comments