panbingkun commented on PR #46937:
URL: https://github.com/apache/spark/pull/46937#issuecomment-2164171368

   > * Another approach is to define a `trait` as follows:
   > 
   > ```
   > trait JdbcDialectHelper {
   >   
   >   def classifyException(
   >       e: Throwable,
   >       errorClass: String,
   >       messageParameters: Map[String, String],
   >       description: String): AnalysisException = {
   >     new AnalysisException(
   >       errorClass = errorClass,
   >       messageParameters = messageParameters,
   >       cause = Some(e))
   >   }
   > }
   > ```
   > 
   > eg:
   > 
   > ```
   > private[sql] case class H2Dialect() extends JdbcDialect with 
`JdbcDialectHelper` {
   > 
   > }
   > ```
   > 
   > and then have various built-in jdbc dialects `with` it, so that there is 
no need to make changes to each built-in jdbc dialects dialect, but this will 
add an extra `trait`.
   > 
   I have already used this
   
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to