GitHub user dongjoon-hyun opened a pull request:
https://github.com/apache/spark/pull/15987
[SPARK-18515][SQL] AlterTableDropPartitions fails for non-string columns
## What changes were proposed in this pull request?
While [SPARK-17732](https://issues.apache.org/jira/browse/SPARK-17732)
improved `PARTITION` specification as a expression, it introduce a regression
which `AlterTableDropPartitions` fails for non-string partitioning columns.
This PR fixes that to use a correct type casting.
```scala
scala> sql("create table tbl_x (a int) partitioned by (p int)")
scala> sql("alter table tbl_x add partition (p=10)")
scala> sql("alter table tbl_x drop partition (p=10)")
scala> sql("alter table tbl_x drop partition (p=10)")
scala.MatchError: (cast(p#8 as double) = 10.0) (of class
org.apache.spark.sql.catalyst.expressions.EqualTo)
```
## How was this patch tested?
Pass the Jenkins tests with new test case.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dongjoon-hyun/spark SPARK-18515
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/15987.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 #15987
----
commit 970a904c5efc1ff2089162c0ca0acbef3f2ca9db
Author: Dongjoon Hyun <[email protected]>
Date: 2016-11-23T01:34:52Z
[SPARK-18515][SQL] AlterTableDropPartitions fails for non-string columns
----
---
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]