GitHub user petermaxlee opened a pull request:
https://github.com/apache/spark/pull/14695
[SPARK-17117][SQL] 1 / NULL should not fail analysis
## What changes were proposed in this pull request?
This patch fixes the problem described in SPARK-17117, i.e. "SELECT 1 /
NULL" throws an analysis exception:
```
org.apache.spark.sql.AnalysisException: cannot resolve '(1 / NULL)' due to
data type mismatch: differing types in '(1 / NULL)' (int and null).
```
The problem is that division type coercion did not take null type into
account.
## How was this patch tested?
A unit test for the type coercion, and a few end-to-end test cases using
SQLQueryTestSuite.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/petermaxlee/spark SPARK-17117
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14695.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 #14695
----
commit 34fddc7a10aa395a01687e040ef523df0bad1610
Author: petermaxlee <[email protected]>
Date: 2016-08-18T03:47:00Z
[SPARK-17117][SQL] 1 / NULL should not fail analysis
commit a946269811540d6cdb2237c62f095f847b461cee
Author: petermaxlee <[email protected]>
Date: 2016-08-18T03:54:15Z
Add end-to-end tests
----
---
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]