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

    https://github.com/apache/spark/pull/6551#discussion_r32385723
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala 
---
    @@ -39,6 +39,16 @@ class SQLQuerySuite extends QueryTest with 
BeforeAndAfterAll with SQLTestUtils {
       val sqlContext = TestSQLContext
       import sqlContext.implicits._
     
    +  test("SPARK-8010: promote numeric to string") {
    +    val df = Seq((1, 1)).toDF("key", "value")
    +    df.registerTempTable("src")
    +    val queryCaseWhen = sql("select case when true then 1.0 else '1' end 
from src ")
    +    val queryCoalesce = sql("select coalesce(null, 1, '1') from src ")
    --- End diff --
    
    My question was about your test case. `case when true then 1.0 else '1' 
end` is basically a constant. Why you think using a string type is good at 
here? Also, if this expression is optimized by our constant folding rule, you 
are not testing the execution side. A case like `case when boolCol then 1.0 
else '1'` may be a better one.


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