GitHub user dilipbiswal opened a pull request:
https://github.com/apache/spark/pull/9036
[SPARK-8654] [SQL] Analysis exception when using NULL IN (...) : invalid
cast
In the analysis phase , while processing the rules for IN predicate, we
compare the in-list types to the lhs expression type and generate
cast operation if necessary. In the case of NULL [NOT] IN expr1 , we end up
generating cast between in list types to NULL like cast (1 as NULL) which
is not a valid cast.
The fix is to find a common type between LHS and RHS expressions and cast
all the expression to the common type.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dilipbiswal/spark spark_8654_new
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/9036.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #9036
----
commit a1ee62904c0bed7aebd429e84f6f14212bd3c097
Author: Dilip Biswal <[email protected]>
Date: 2015-10-02T23:20:56Z
[SPARK-8654] Analysis exception when using NULL IN (...) : invalid cast
In the analysis phase , while processing the rules for IN predicate, we
compare the in-list types to the lhs expression type and generate
cast operation if necessary. In the case of NULL [NOT] IN expr1 , we end up
generating cast between in list types to NULL like cast (1 as NULL) which
is not a valid cast.
The fix is to not generate such a cast if the lhs type is a NullType instead
we translate the expression to Literal(Null).
----
---
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]