GitHub user ueshin opened a pull request:
https://github.com/apache/spark/pull/22200
[SPARK-25208][SQL] Loosen Cast.forceNullable for DecimalType.
## What changes were proposed in this pull request?
Casting to `DecimalType` is not always needed to force nullable.
If the decimal type to cast is wider than original type, or only truncating
or precision loss, the casted value won't be `null`.
## How was this patch tested?
Added and modified tests.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ueshin/apache-spark
issues/SPARK-25208/cast_nullable_decimal
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/22200.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 #22200
----
commit e134258738c0dfa43533422d88bd16ce90e92743
Author: Takuya UESHIN <ueshin@...>
Date: 2018-08-23T10:05:26Z
Loosen `Cast.forceNullable` for DecimalType.
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]