wangyum commented on a change in pull request #26068: [SPARK-29405][SQL] Alter
table / Insert statements should not change a table's ownership
URL: https://github.com/apache/spark/pull/26068#discussion_r334524712
##########
File path:
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala
##########
@@ -573,8 +574,9 @@ private[hive] class HiveClientImpl(
// If users explicitly alter these Hive-specific properties through ALTER
TABLE DDL, we respect
// these user-specified values.
verifyColumnDataType(table.dataSchema)
+ val owner = Option(table.owner).filter(_.nonEmpty).getOrElse(userName)
Review comment:
Could we move this change to
[HiveClientImpl.scala#L1043](https://github.com/apache/spark/blob/a6721ca93857acea1bfbc34046b967a39f8a5fa3/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala#L1043)?
```scala
Option(table.owner).filter(_.nonEmpty).orElse(userName).foreach(hiveTable.setOwner)
```
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]