You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/12/31 13:37:16 UTC

[GitHub] [doris] englefly commented on a diff in pull request #15466: [Bug](filter) fix not in(null) return true

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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org