gaborgsomogyi commented on a change in pull request #27637: [SPARK-30874][SQL] 
Support Postgres Kerberos login in JDBC connector
URL: https://github.com/apache/spark/pull/27637#discussion_r387581400
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCOptions.scala
 ##########
 @@ -187,6 +190,22 @@ class JDBCOptions(
 
   // An option to allow/disallow pushing down predicate into JDBC data source
   val pushDownPredicate = parameters.getOrElse(JDBC_PUSHDOWN_PREDICATE, 
"true").toBoolean
+
+  // The local path of user's keytab file, which is assumed to be pre-uploaded 
to all nodes either
+  // by --files option of spark-submit or manually
+  val keytab = {
+    val keytabParam = parameters.getOrElse(JDBC_KEYTAB, null)
+    if (keytabParam != null && FilenameUtils.getPath(keytabParam).isEmpty) {
+      val result = SparkFiles.get(keytabParam)
+      logDebug(s"Keytab path not found, assuming --files, file name used on 
executor: $result")
+      result
+    } else {
+      logDebug("No keytab path found, assuming manual upload")
 
 Review comment:
   Fixed.

----------------------------------------------------------------
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]

Reply via email to