You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Marco Gaido (JIRA)" <ji...@apache.org> on 2017/11/01 20:46:01 UTC

[jira] [Created] (SPARK-22413) Type coercion for IN is not coherent between Literals and subquery

Marco Gaido created SPARK-22413:
-----------------------------------

             Summary: Type coercion for IN is not coherent between Literals and subquery
                 Key: SPARK-22413
                 URL: https://issues.apache.org/jira/browse/SPARK-22413
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 2.3.0
            Reporter: Marco Gaido
            Priority: Major


The IN statement can have a different behavior according to whether there is a list of literals or a subquery, because the type coercion works differently in the two cases.

This means, that these two equivalent queries return different results:

{code}
select 1 from (select 1) a where 1 in ('01'); // this returns an empty dataset
select 1 from (select 1) a where 1 in (select '01' from (select 1)); // returns 1 row
{code}




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org