Github user bomeng commented on a diff in the pull request:
https://github.com/apache/spark/pull/12252#discussion_r59819746
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala
---
@@ -246,13 +247,23 @@ object JdbcUtils extends Logging {
}
/**
+ * The utility to add quote to the column name based on its dialect
+ * @param dialect the JDBC dialect
+ * @param columnName the input column name
+ * @return the quoted column name
+ */
+ private def quoteColumnName(dialect: JdbcDialect, columnName: String):
String = {
+ dialect.quoteIdentifier(columnName)
+ }
+
+ /**
* Compute the schema string for this RDD.
*/
- def schemaString(df: DataFrame, url: String): String = {
+ def schemaString(dialect: JdbcDialect, df: DataFrame, url: String):
String = {
val sb = new StringBuilder()
val dialect = JdbcDialects.get(url)
--- End diff --
The purpose to pass in dialect is to get proper quote for columns based on
its data source. Any suggestion?
---
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]