spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ayan guha <guha.a...@gmail.com>
Subject Re: Multiple filters vs multiple conditions
Date Tue, 03 Oct 2017 13:01:06 GMT
Remember transformations are lazy.....so nothing happens until you call an
action.....at that point both are same.

On Tue, Oct 3, 2017 at 11:19 PM, Femi Anthony <femibyte@gmail.com> wrote:

> I would assume that the optimizer would end up transforming both to the
> same expression.
>
> Femi
>
> Sent from my iPhone
>
> > On Oct 3, 2017, at 8:14 AM, Ahmed Mahmoud <don1559@gmail.com> wrote:
> >
> > Hi All,
> >
> > Just a quick question from an optimisation point of view:
> >
> > Approach 1:
> > .filter (t-> t.x=1 && t.y=2)
> >
> > Approach 2:
> > .filter (t-> t.x=1)
> > .filter (t-> t.y=2)
> >
> > Is there a difference or one is better than the other  or both are same?
> >
> > Thanks!
> > Ahmed Mahmoud
> >
>
> ---------------------------------------------------------------------
> To unsubscribe e-mail: user-unsubscribe@spark.apache.org
>
>


-- 
Best Regards,
Ayan Guha

Mime
View raw message