urosstan-db commented on code in PR #59748:
URL: https://github.com/apache/spark/pull/59748#discussion_r4361488988


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRelation.scala:
##########
@@ -267,19 +272,21 @@ private[sql] object JDBCRelation extends Logging {
       jdbcOptions: JDBCOptions)(
       sparkSession: SparkSession): JDBCRelation = {
     val remoteSchemaFetchMetric = 
JdbcUtils.createSchemaFetchMetric(sparkSession.sparkContext)
-    val schema = SQLMetrics.withTimingNs(remoteSchemaFetchMetric) {
-      JDBCRelation.getSchema(sparkSession.sessionState.conf.resolver, 
jdbcOptions)
+    val (schema, databaseMetadata) = 
SQLMetrics.withTimingNs(remoteSchemaFetchMetric) {
+      getSchemaAndDatabaseMetadata(sparkSession.sessionState.conf.resolver, 
jdbcOptions)
     }
     JDBCRelation(schema, parts, jdbcOptions,
-      Map(schemaFetchKey -> remoteSchemaFetchMetric))(sparkSession)
+      Map(schemaFetchKey -> remoteSchemaFetchMetric))(sparkSession, 
Some(databaseMetadata))
   }
 }
 
 private[sql] case class JDBCRelation(
     override val schema: StructType,
     parts: Array[Partition],
     jdbcOptions: JDBCOptions,
-    additionalMetrics: Map[String, SQLMetric] = Map())(@transient val 
sparkSession: SparkSession)
+    additionalMetrics: Map[String, SQLMetric] = Map())(
+    @transient val sparkSession: SparkSession,
+    val databaseMetadata: Option[JDBCDatabaseMetadata] = None)

Review Comment:
   How big is JDBCDatabaseMetadata, does it need to be transient as well?



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