You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Herman van Hovell (JIRA)" <ji...@apache.org> on 2016/08/31 10:19:20 UTC

[jira] [Commented] (SPARK-17322) 'ANY n' clause for SQL queries to increase the ease of use of WHERE clause predicates

    [ https://issues.apache.org/jira/browse/SPARK-17322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15451825#comment-15451825 ] 

Herman van Hovell commented on SPARK-17322:
-------------------------------------------

Is this use of {{ANY}} part of the SQL standard?

You could add an expression to do this, but you could also just write:
{noformat}
select symbol
from   stocks
where  cast(market_cap > 5.7b as int) +
       cast(analysts_recommend > 10 as int) +
       cast(moving_avg > 49.2 as int) +
       cast(pe_ratio >15.4 as int) >= 3
{noformat}

> 'ANY n' clause for SQL queries to increase the ease of use of WHERE clause predicates
> -------------------------------------------------------------------------------------
>
>                 Key: SPARK-17322
>                 URL: https://issues.apache.org/jira/browse/SPARK-17322
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Suman Somasundar
>            Priority: Minor
>
> If the user is interested in getting the results that meet 'any n' criteria out of m where clause predicates (m > n), then the 'any n' clause greatly simplifies writing a SQL query.
> An example is given below:
> select symbol from stocks where (market_cap > 5.7b, analysts_recommend > 10, moving_avg > 49.2, pe_ratio >15.4) ANY 3



--
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