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 2019/08/02 16:15:05 UTC

[GitHub] [spark] WeichenXu123 commented on a change in pull request #25294: [SPARK-28476][SQL] Support ALTER DATABASE SET LOCATION

WeichenXu123 commented on a change in pull request #25294: [SPARK-28476][SQL] Support ALTER DATABASE SET LOCATION
URL: https://github.com/apache/spark/pull/25294#discussion_r310202074
 
 

 ##########
 File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala
 ##########
 @@ -361,13 +361,16 @@ private[hive] class HiveClientImpl(
   }
 
   override def alterDatabase(database: CatalogDatabase): Unit = withHiveState {
+    val location = CatalogUtils.URIToString(database.locationUri)
+    val dbName = database.name
     client.alterDatabase(
-      database.name,
+      dbName,
       new HiveDatabase(
-        database.name,
+        dbName,
         database.description,
-        CatalogUtils.URIToString(database.locationUri),
+        location,
         Option(database.properties).map(_.asJava).orNull))
+    client.getDatabase(dbName).setLocationUri(location)
 
 Review comment:
   CC @gatorsmile 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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