hddong commented on a change in pull request #23952: [SPARK-26929][SQL]fix
table owner use user instead of principal when create table through spark-sql
or beeline
URL: https://github.com/apache/spark/pull/23952#discussion_r317426204
##########
File path:
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala
##########
@@ -191,7 +193,12 @@ private[hive] class HiveClientImpl(
/** Returns the configuration for the current session. */
def conf: HiveConf = state.getConf
- private val userName = conf.getUser
+ private val userName: String = try {
+ val ugi = HiveUtils.getUGI
+ ugi.getShortUserName
Review comment:
> org.apache.hadoop.hive.shims.Utils.getUGI.getShortUserName
Yep, but `shims.Utils` is not compatible with hive0.*. This file is added
after hive1.*, so, copy the source code here.
----------------------------------------------------------------
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]