Skip to content
  • Dongjoon Hyun's avatar
    8a8d26f1
    [SPARK-16672][SQL] SQLBuilder should not raise exceptions on EXISTS queries · 8a8d26f1
    Dongjoon Hyun authored
    ## 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.
    
    Author: Dongjoon Hyun <dongjoon@apache.org>
    
    Closes #14307 from dongjoon-hyun/SPARK-16672.
    8a8d26f1
    [SPARK-16672][SQL] SQLBuilder should not raise exceptions on EXISTS queries
    Dongjoon Hyun authored
    ## 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.
    
    Author: Dongjoon Hyun <dongjoon@apache.org>
    
    Closes #14307 from dongjoon-hyun/SPARK-16672.
Loading