Github user steveloughran commented on a diff in the pull request:
https://github.com/apache/spark/pull/15594#discussion_r89787175
--- Diff:
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIService.scala
---
@@ -57,7 +59,24 @@ private[hive] class SparkSQLCLIService(hiveServer:
HiveServer2, sqlContext: SQLC
case e @ (_: IOException | _: LoginException) =>
throw new ServiceException("Unable to login to kerberos with
given principal/keytab", e)
}
- }
+
+ // Also try creating a UGI object for the SPNego principal
+ val principal =
hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_PRINCIPAL)
+ val keyTabFile = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_KEYTAB)
+ if (principal.isEmpty() || keyTabFile.isEmpty()) {
+ getAncestorField[Log](this, 3, "LOG").info(
--- End diff --
I don't know about the specific log policy here; but I do think using
reflection to get a private stuff is dangerous. I know it happens a lot in this
code but at some point it'd be nice to move it. you don't need to use
reflection to get the same log as a parent, just go
```
LoggerFactory.getLog("org.apache.hive.thrift...whatever").info(s"something
$key")
```
This is cleaner and not going to break if hive ever change logging
frameworks.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]