cloud-fan commented on a change in pull request #26080: [SPARK-29425][SQL] The ownership of a database should be respected URL: https://github.com/apache/spark/pull/26080#discussion_r353032671
########## File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala ########## @@ -379,22 +383,31 @@ private[hive] class HiveClientImpl( s"Hive ${version.fullVersion} does not support altering database location") } } - client.alterDatabase( + val props = database.properties + val dbOwner = props.get(PROP_OWNER_NAME).filter(_.nonEmpty).getOrElse(userName) + val dbOwnerType = props.get(PROP_OWNER_TYPE).filter(_.nonEmpty).getOrElse("USER") + + val hiveDb = new HiveDatabase( Review comment: shall we create a `toHiveDatabase` method for the code here? to remove duplicated code ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org