GitHub user zhichao-li opened a pull request:
https://github.com/apache/spark/pull/8811
[SPARK-10656][SQL]fix selection fails when a column has special characters
Best explained with this example:
val df = sqlContext.read.json(sqlContext.sparkContext.makeRDD(
"""{"a.b": "c", "d": "e" }""" :: Nil))
df.select("*").show() //successful
df.select(df("*")).show() //throws exception
df.withColumnRenamed("d", "f").show() //also fails
This PR address this by adding back tick for the column names.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zhichao-li/spark specialChars
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/8811.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 #8811
----
commit 2fa0aa69e92b69ab9433e5ced4e6fd1b4047cb70
Author: zhichao.li <[email protected]>
Date: 2015-09-18T07:13:31Z
fix selection fails when a column has special characters
----
---
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]