srowen commented on a change in pull request #25287:
[SPARK-28552][SQL]Identification of different dialects insensitive to case by
JDBC URL prefix
URL: https://github.com/apache/spark/pull/25287#discussion_r339561571
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala
##########
@@ -56,13 +57,26 @@ case class JdbcType(databaseTypeDefinition : String,
jdbcNullType : Int)
*/
@DeveloperApi
abstract class JdbcDialect extends Serializable {
+ /**
+ * The tag of the database, it must be lowercase, the subsequent will match
+ * the corresponding dialect through this tag, so it must be strictly
one-to-one
+ * correspondence with jdbc url,such as:
+ * mysql url: jdbc:mysql://localhost/db dbTag: mysql
+ * oracle url: jdbc:oracle://localhost/db dbTag: oracle
+ * db2 url: jdbc:db2://localhost/db dbTag: db2
+ * ......
+ */
+ def dbTag: String
Review comment:
Hm, the problem here is that this will break any custom dialects as it adds
a new required method to implement. I am not sure it's worth it, even though we
can possibly introduce such breaking changes. Part of the reason I don't think
it's worth it is just that a non-lowercase string is pretty nonstandard.
I would either push the lowercase down into each implementation, or provide
a default implementation that returns nothing. That at least covers existing
implementations which will already override `canHandle`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]