clintropolis commented on a change in pull request #11060:
URL: https://github.com/apache/druid/pull/11060#discussion_r606168284



##########
File path: sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java
##########
@@ -17086,4 +17086,32 @@ public void testGroupingSetsWithLimitOrderByGran() 
throws Exception
         ).build()
     );
   }
+
+
+  @Test
+  public void testLookupWithNull() throws Exception
+  {
+    testQuery(
+        "SELECT dim2 ,lookup(dim2,'lookyloo') from foo where dim2 is null",
+        ImmutableList.of(
+            new Druids.ScanQueryBuilder()
+            .dataSource(CalciteTests.DATASOURCE1)
+            .intervals(querySegmentSpec(Filtration.eternity()))
+            .virtualColumns(
+                expressionVirtualColumn("v0", "null", ValueType.STRING)
+            )
+            .columns("v0")
+            .legacy(false)
+            .filters(new SelectorDimFilter("dim2", "", null))
+            .resultFormat(ScanQuery.ResultFormat.RESULT_FORMAT_COMPACTED_LIST)
+            .context(QUERY_CONTEXT_DEFAULT)
+            .build()
+        ),
+        ImmutableList.<Object[]>builder().add(
+            new Object[]{"", NULL_STRING},
+            new Object[]{"", NULL_STRING},
+            new Object[]{"", NULL_STRING}

Review comment:
       I restarted CI for the failing test. Looking at the new test though, I'm 
not sure it tests the issue anymore since the input to the lookup is no longer 
null? I actually think maybe the old test was better, you just needed to adjust 
the expected output based on whether or not it is in default null handling mode 
or not.e.g 
   ```
   List<Object[]> expected;
   if (useDefault) {
     expected = ImmutableList.<Object[]>builder().add(
   ...
   ```
   like some of the other tests are doing.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to