GitHub user dongjoon-hyun opened a pull request:

    https://github.com/apache/spark/pull/14307

    [SPARK-16672][SQL] SQLBuilder should not raise exceptions on EXISTS queries

    ## What changes were proposed in this pull request?
    
    Currently, `SQLBuilder` raises `empty.reduceLeft` exceptions on 
*unoptimized* `EXISTS` queries. We had better prevent this.
    ```scala
    scala> sql("CREATE TABLE t1(a int)")
    scala> val df = sql("select * from t1 b where exists (select * from t1 a)")
    scala> new org.apache.spark.sql.catalyst.SQLBuilder(df).toSQL
    java.lang.UnsupportedOperationException: empty.reduceLeft
    ```
    
    ## How was this patch tested?
    
    Pass the Jenkins tests with a new test suite.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dongjoon-hyun/spark SPARK-16672

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/14307.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #14307
    
----
commit 7baab5ef66f2091ba9f33a32b8005c3f85354e6b
Author: Dongjoon Hyun <[email protected]>
Date:   2016-07-21T20:12:58Z

    [SPARK-16672][SQL] SQLBuilder should not raise exceptions on EXISTS queries

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to