Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13392#discussion_r65123693
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/internal/SQLConfSuite.scala ---
    @@ -219,4 +220,41 @@ class SQLConfSuite extends QueryTest with 
SharedSQLContext {
         }
       }
     
    +  test("MAX_CASES_BRANCHES") {
    +    import testImplicits._
    +
    +    val original = spark.conf.get(SQLConf.MAX_CASES_BRANCHES)
    +    try {
    +      withTable("tab1") {
    +        spark
    +          .range(10)
    +          .select('id as 'a, 'id as 'b, 'id as 'c, 'id as 'd)
    +          .write
    +          .saveAsTable("tab1")
    +
    +        val sql_one_branch_caseWhen = "SELECT CASE WHEN a = 1 THEN 1 END 
FROM tab1"
    +        val sql_two_branch_caseWhen = "SELECT CASE WHEN a = 1 THEN 1 ELSE 
0 END FROM tab1"
    +
    +        spark.conf.set(SQLConf.MAX_CASES_BRANCHES.key, "0")
    --- End diff --
    
    how about:
    ```
    withTable {
      spark.range(10)....
      val oneBranchCaseWhen = ....
      val twoBranchCaseWhen = ...
      withConf {
        assert(...)
      }
      withConf {
        assert(...)
      }
      withConf {
        assert(...)
      }
    }
    ```


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to