englefly commented on code in PR #15466:
URL: https://github.com/apache/doris/pull/15466#discussion_r1059645378
##########
be/src/vec/exec/scan/vscan_node.cpp:
##########
@@ -771,6 +771,13 @@ Status
VScanNode::_normalize_not_in_and_not_eq_predicate(VExpr* expr, VExprConte
->get_function_state(FunctionContext::FRAGMENT_LOCAL));
HybridSetBase::IteratorBase* iter = state->hybrid_set->begin();
auto fn_name = std::string("");
+
+ // not in(any, null) == (x!=any and x!=null)
+ // (x!=null)=null=false, so not in(any, null) return always false
Review Comment:
`in (any, null)` does not always return false, in fact, it returns `null`.
an counter example:
`k not in (null)` returns null, so `not ( k not in (null)` returns null.
`select * from t where k not in (null) ` returns empty result set.
`select * from t where not (k not in (null)) ` returns empty result set too.
--
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]