Github user stanzhai commented on the issue:

    https://github.com/apache/spark/pull/18986
  
    @gatorsmile @DonnyZone  When comparing a string to a int in Hive, it will 
cast string type to double.
    
    ```
    hive> select * from tb;
    0   0
    0.1 0
    true        0
    19157170390056971   0
    hive> select * from tb where a = 0;
    0   0
    hive> select * from tb where a = 19157170390056973L;
    WARNING: Comparing a bigint and a string may result in a loss of precision.
    19157170390056973   0
    hive> select 1 = 'true';
    NULL
    hive> select 19157170390056973L = '19157170390056971';
    WARNING: Comparing a bigint and a string may result in a loss of precision.
    true
    ```
    
    So, I think that cast a string to double type when compare with a numeric 
is more reasonable.
    
    Actually, my usage scenarios are for Spark compatibility. The problem I 
found when I upgraded Spark to 2.2.0, and lots of SQL's results are wrong.
    



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