beliefer commented on code in PR #43949:
URL: https://github.com/apache/spark/pull/43949#discussion_r1409265752


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/connector/SimpleTableProvider.scala:
##########
@@ -31,6 +31,7 @@ trait SimpleTableProvider extends TableProvider {
   def getTable(options: CaseInsensitiveStringMap): Table
 
   private[this] var loadedTable: Table = _
+

Review Comment:
   Please revert this line.



##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalog.scala:
##########
@@ -73,7 +74,44 @@ class V2SessionCatalog(catalog: SessionCatalog)
 
   override def loadTable(ident: Identifier): Table = {
     try {
-      V1Table(catalog.getTableMetadata(ident.asTableIdentifier))
+      val table = catalog.getTableMetadata(ident.asTableIdentifier)
+      if (table.provider.isDefined) {
+        DataSourceV2Utils.getTableProvider(table.provider.get, conf) match {
+          case Some(provider) =>
+            // Get the table properties during creation and append the path 
option
+            // to the properties.
+            val tableProperties = table.properties
+            val pathOption = table.storage.locationUri.map("path" -> 
CatalogUtils.URIToString(_))
+            val properties = tableProperties ++ pathOption

Review Comment:
   ```suggestion
               val properties = table.properties ++
                 table.storage.locationUri.map("path" -> 
CatalogUtils.URIToString(_))
   ```



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