HeartSaVioR 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_r316973255
########## 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: Looks like `Utils` is accessible from here, so if we just want to leverage Hive code and call `getShortUserName` instead, we can just do it with one-liner. ``` private val userName = org.apache.hadoop.hive.shims.Utils.getUGI.getShortUserName ``` ---------------------------------------------------------------- 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