Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21174#discussion_r184606904
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala 
---
    @@ -955,4 +955,28 @@ class SubquerySuite extends QueryTest with 
SharedSQLContext {
         // before the fix this would throw AnalysisException
         spark.range(10).where("(id,id) in (select id, null from 
range(3))").count
       }
    +
    +  test("SPARK-24085 scalar subquery in partitioning expression") {
    +    withTempPath { tempDir =>
    +      withTable("parquet_part") {
    +        sql(
    +          s"""
    +             |CREATE TABLE parquet_part (id_value string, id_type string)
    +             |USING PARQUET
    +             |OPTIONS (
    +             |  path '${tempDir.toURI}'
    +             |)
    +             |PARTITIONED BY (id_type)
    --- End diff --
    
    ```Scala
            Seq("1" -> "a", "2" -> "a", "3" -> "b", "4" -> "b")
              .toDF("id_value", "id_type")
              .write
              .mode(SaveMode.Overwrite)
              .partitionBy("id_type")
              .format("parquet")
              .saveAsTable("parquet_part")
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to