You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/05/26 04:24:54 UTC

[GitHub] [spark] cloud-fan commented on a diff in pull request #36625: [SPARK-39203][SQL] Rewrite table location to absolute location based on database location

cloud-fan commented on code in PR #36625:
URL: https://github.com/apache/spark/pull/36625#discussion_r882302960


##########
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala:
##########
@@ -842,10 +843,12 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat
     // source tables. Here we set the table location to `locationUri` field and filter out the
     // path option in storage properties, to avoid exposing this concept externally.
     val storageWithLocation = {
-      val tableLocation = getLocationFromStorageProps(table)
+      val tableLocation = getLocationFromStorageProps(table).map { loc =>
+        val uri = CatalogUtils.stringToURI(loc)
+        table.storage.locationUri.map(HiveExternalCatalog.toAbsoluteURI(uri, _)).getOrElse(uri)

Review Comment:
   `table.storage.locationUri` is the table location, not database location, isn't it?



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org