GitHub user clockfly opened a pull request:
https://github.com/apache/spark/pull/13306
[SPARK-12988][SQL] Can't drop top level columns that contain dots
## What changes were proposed in this pull request?
This PR is work based on @dilipbiswal's
https://github.com/apache/spark/pull/10943
This PR fix problems like:
```
scala> Seq((1, 2)).toDF("a.b", "a.c").drop("a.b")
org.apache.spark.sql.AnalysisException: cannot resolve '`a.c`' given input
columns: [a.b, a.c];
```
`drop(columnName)` can only be used to drop top level column, so, we should
parse the column name literally with interpreting dot "."
We should also NOT interpret back tick "`", otherwise it is hard to
understand what
```
â```aaa```bbb``
```
actually means.
## How was this patch tested?
Unit tests.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/clockfly/spark fix_drop_column
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/13306.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 #13306
----
commit 4ca70b9bf2ede04875e0101e5ae46d9103b0e722
Author: Sean Zhong <[email protected]>
Date: 2016-05-23T00:11:23Z
fix the drop column issue.
----
---
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]