GitHub user bomeng opened a pull request:
https://github.com/apache/spark/pull/12252
[SPARK-14460] [SQL] properly handling of column name contains space
## What changes were proposed in this pull request?
Although it is not recommended, table can be created with column name
containing space. For example,
>
create table test.people1 (name TEXT(32) NOT NULL,\`the id\` INTEGER NOT
NULL)
>
When we query the table via JDBC, we also need to escape the column name in
the same way if the column name contains space.
I've create a method to do the escape, it will only add backtick if column
name contains space.
## How was this patch tested?
I've updated the test case to test this scenario.
Other thought:
Is there any other cases we have to escape the column name? Or do we have
to always use backtick for each column name?
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/bomeng/spark SPARK-14460
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/12252.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 #12252
----
commit 88935c5b0eb371476c4f27be26454449fb072e7f
Author: bomeng <[email protected]>
Date: 2016-04-08T03:25:33Z
fix issue of column name contains space
----
---
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]