rxin=# select null and true;
 ?column?
----------

(1 row)

rxin=# select null and false;
 ?column?
----------
 f
(1 row)


null and false should return false.


On Mon, Sep 14, 2015 at 9:12 PM, Zack Sampson <zsamp...@palantir.com> wrote:

> It seems like And.eval can avoid calculating right.eval if left.eval
> returns null. Is there a reason it's written like it is?
>
> override def eval(input: Row): Any = {
>   val l = left.eval(input)
>   if (l == false) {
>     false
>   } else {
>     val r = right.eval(input)
>     if (r == false) {
>       false
>     } else {
>       if (l != null && r != null) {
>         true
>       } else {
>         null
>       }
>     }
>   }
> }
>
>

Reply via email to