spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiu (Joe) Guo (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SPARK-13283) Spark doesn't escape column names when creating table on JDBC
Date Tue, 16 Feb 2016 21:57:18 GMT

    [ https://issues.apache.org/jira/browse/SPARK-13283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15149387#comment-15149387
] 

Xiu (Joe) Guo commented on SPARK-13283:
---------------------------------------

Yes, it is a different problem from [SPARK-13297|https://issues.apache.org/jira/browse/SPARK-13297].
We should escape the column name based on JdbcDialect.

> Spark doesn't escape column names when creating table on JDBC
> -------------------------------------------------------------
>
>                 Key: SPARK-13283
>                 URL: https://issues.apache.org/jira/browse/SPARK-13283
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.6.0
>            Reporter: Maciej BryƄski
>
> Hi,
> I have following problem.
> I have DF where one of the columns has 'from' name.
> {code}
> root
>  |-- from: decimal(20,0) (nullable = true)
> {code}
> When I'm saving it to MySQL database I'm getting error:
> {code}
> Py4JJavaError: An error occurred while calling o183.jdbc.
> : com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your
SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax
to use near 'from DECIMAL(20,0) , ' at line 1
> {code}
> I think the problem is that Spark doesn't escape column names with ` sign on creating
table.
> {code}
> `from`
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message