Github user rick-ibm commented on the pull request:

    https://github.com/apache/spark/pull/8983#issuecomment-146271123
  
    Hi Michael,
    
    Postgres and Derby raise an error if the expressions in the IN list can't 
be implicitly cast to a common type. MySQL is more forgiving.
    
    Thanks,
    -Rick
    
    ---------------------------------
    
    MySQL:
    
    mysql> SELECT NULL IN ( 1, 'abc' );
    SELECT NULL IN ( 1, 'abc' );
    +----------------------+
    | NULL IN ( 1, 'abc' ) |
    +----------------------+
    |                 NULL |
    +----------------------+
    1 row in set (0.00 sec)
    
    
    ---------------------------------
    
    Postgres:
    
    mydb=# SELECT NULL IN ( 1, 'abc' );
    SELECT NULL IN ( 1, 'abc' );
    ERROR:  invalid input syntax for integer: "abc"
    LINE 1: SELECT NULL IN ( 1, 'abc' );
    
    
    ---------------------------------
    
    Derby:
    
    ij> VALUES CAST (NULL AS INT) IN (1, 'abc' );
    ERROR 42818: Comparisons between 'INTEGER' and 'CHAR (UCS_BASIC)' are not 
supported. Types must be comparable. String types must also have matching 
collation. If collation does not match, a possible solution is to cast operands 
to force them to the default collation (e.g. SELECT tablename FROM 
sys.systables WHERE CAST(tablename AS VARCHAR(128)) = 'T1')



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