spark-instrumented-optimizer/common
Wenchen Fan 6b34e745bb [SPARK-19178][SQL] convert string of large numbers to int should return null
## What changes were proposed in this pull request?

When we convert a string to integral, we will convert that string to `decimal(20, 0)` first, so that we can turn a string with decimal format to truncated integral, e.g. `CAST('1.2' AS int)` will return `1`.

However, this brings problems when we convert a string with large numbers to integral, e.g. `CAST('1234567890123' AS int)` will return `1912276171`, while Hive returns null as we expected.

This is a long standing bug(seems it was there the first day Spark SQL was created), this PR fixes this bug by adding the native support to convert `UTF8String` to integral.

## How was this patch tested?

new regression tests

Author: Wenchen Fan <wenchen@databricks.com>

Closes #16550 from cloud-fan/string-to-int.
2017-01-12 22:52:34 -08:00
..
network-common [SPARK-18972][CORE] Fix the netty thread names for RPC 2016-12-22 16:22:55 -08:00
network-shuffle [SPARK-17807][CORE] split test-tags into test-JAR 2016-12-21 16:37:20 -08:00
network-yarn [SPARK-17807][CORE] split test-tags into test-JAR 2016-12-21 16:37:20 -08:00
sketch [SPARK-17807][CORE] split test-tags into test-JAR 2016-12-21 16:37:20 -08:00
tags [SPARK-18993][BUILD] Unable to build/compile Spark in IntelliJ due to missing Scala deps in spark-tags 2016-12-28 12:17:33 +00:00
unsafe [SPARK-19178][SQL] convert string of large numbers to int should return null 2017-01-12 22:52:34 -08:00