You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Zhongshuai Pei (JIRA)" <ji...@apache.org> on 2015/05/07 08:59:59 UTC

[jira] [Updated] (SPARK-7437) Fold "literal in (item1, item2, ..., literal, ...)" into false directly if not in.

     [ https://issues.apache.org/jira/browse/SPARK-7437?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zhongshuai Pei updated SPARK-7437:
----------------------------------
    Description: 
just Fold "literal in (item1, item2, ..., literal, ...)" into true directly if in
{quote}
case In(Literal(v, _), list) if list.exists {
          case Literal(candidate, _) if candidate == v => true
          case _ => false
        } => Literal.create(true, BooleanType)
{quote}

Fold "literal in (item1, item2, ..., literal, ...)" into true or false directly.
{quote}
      case In(Literal(v, _), list) =>
        val isExists = list.exists {
          case Literal(candidate, _) if candidate == v => true
          case _ => false
        }
        if (isExists) Literal.create(true, BooleanType) else Literal.create(false, BooleanType)
{quote}


> Fold "literal in (item1, item2, ..., literal, ...)" into false directly if not in.
> ----------------------------------------------------------------------------------
>
>                 Key: SPARK-7437
>                 URL: https://issues.apache.org/jira/browse/SPARK-7437
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 1.3.1
>            Reporter: Zhongshuai Pei
>
> just Fold "literal in (item1, item2, ..., literal, ...)" into true directly if in
> {quote}
> case In(Literal(v, _), list) if list.exists {
>           case Literal(candidate, _) if candidate == v => true
>           case _ => false
>         } => Literal.create(true, BooleanType)
> {quote}
> Fold "literal in (item1, item2, ..., literal, ...)" into true or false directly.
> {quote}
>       case In(Literal(v, _), list) =>
>         val isExists = list.exists {
>           case Literal(candidate, _) if candidate == v => true
>           case _ => false
>         }
>         if (isExists) Literal.create(true, BooleanType) else Literal.create(false, BooleanType)
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org