Github user DonnyZone commented on the issue:

    https://github.com/apache/spark/pull/18986
  
    @gatorsmile For this issue, I think the behevior in PromoteStrings rule is 
reasonable, but there are problems in underlying converter UTF8String.
    
    As described in PR-15880 (https://github.com/apache/spark/pull/15880):
    > It's more reasonable to follow postgres, i.e. cast string to the type of 
the other side, but return null if the string is not castable to keep hive 
compatibility.
    
    However, the underlying UTF8String still returns true for cases that are 
not castable. From the below code, we can get res=true and wrapper.value=0. 
Consequently, it results in wrong answer in SPARK-21774.
    ```
    val x = UTF8String.fromString("0.1")
    val wrapper = new IntWrapper
    val res = x.toInt(wrapper)
    ```


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