clintropolis commented on code in PR #15974:
URL: https://github.com/apache/druid/pull/15974#discussion_r1507243354
##########
sql/src/test/java/org/apache/druid/sql/calcite/CalciteLookupFunctionQueryTest.java:
##########
@@ -856,17 +856,12 @@ public void testFilterMvContainsIsNotTrue()
testQuery(
buildFilterTestSql("MV_CONTAINS(lookup(dim1, 'lookyloo'), 'xabc') IS
NOT TRUE"),
QUERY_CONTEXT,
- NullHandling.sqlCompatible()
- ? buildFilterTestExpectedQuery(
- expressionVirtualColumn("v0", "lookup(\"dim1\",'lookyloo')",
ColumnType.STRING),
- not(equality("v0", "xabc", ColumnType.STRING))
- )
- : buildFilterTestExpectedQuery(
- not(equality("dim1", "abc", ColumnType.STRING))
+ buildFilterTestExpectedQuery(
+ NullHandling.sqlCompatible()
+ ? not(istrue(equality("dim1", "abc", ColumnType.STRING)))
+ : not(equality("dim1", "abc", ColumnType.STRING))
),
- NullHandling.sqlCompatible()
- ? ImmutableList.of()
- : ImmutableList.of(new Object[]{"", 5L})
+ ImmutableList.of(new Object[]{NullHandling.defaultStringValue(), 5L})
Review Comment:
the expected results in SQL compatible mode were incorrect before in this
test because `mv_contains` was considered not nullable by the SQL planner so
the 'is not true' part was eliminated translating the filter into:
```
NOT(MV_CONTAINS(lookup(dim1, 'lookyloo'), 'xabc'))
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]