GitHub user icexelloss opened a pull request:
https://github.com/apache/spark/pull/22208
Improve error message when a column containing dot cannot be resolved
## What changes were proposed in this pull request?
The current error message is often confusing to a new Spark user that a
column containing "." needs backticks quote.
For example, consider the following code:
```
spark.range(0, 1).toDF('a.b')['a.b']
```
the current message looks like:
```
Cannot resolve column name "a.b" among (a.b)
```
This PR improves the error message to,
```
Cannot resolve column name "a.b" among (a.b). Try adding backticks to the
column name, i.e., `a.b`;
```
## How was this patch tested?
Manual test in shell
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/icexelloss/spark
SPARK-25216-backticks-error-message
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/22208.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 #22208
----
commit 21a3732104f311785946a0808dbc132f0e7a892e
Author: Li Jin <ice.xelloss@...>
Date: 2018-08-23T18:42:37Z
Improve error message when a column containing dot cannot be resolved
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]