pan3793 commented on code in PR #7113:
URL: https://github.com/apache/kyuubi/pull/7113#discussion_r2166622488
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/flink/FlinkProcessBuilder.scala:
##########
@@ -228,7 +228,21 @@ class FlinkProcessBuilder(
hadoopCp.foreach(classpathEntries.add)
val extraCp = conf.get(ENGINE_FLINK_EXTRA_CLASSPATH)
extraCp.foreach(classpathEntries.add)
- if (hadoopCp.isEmpty && extraCp.isEmpty) {
+
+ val flinkLibDir = Paths.get(flinkHome)
+ .resolve("lib")
+ .toFile
+
+ val hadoopJars = Option(flinkLibDir.listFiles(new FilenameFilter {
+ override def accept(dir: File, name: String): Boolean = {
+ name.toLowerCase.contains("hadoop") ||
+ name.toLowerCase.contains("flink-shaded-hadoop")
+ }
+ })).getOrElse(Array.empty)
+
+ val hasHadoopJar = hadoopJars.nonEmpty
Review Comment:
simplify to
```suggestion
val hasHadoopJar = Paths.get(flinkHome)
.resolve("lib")
.toFile
.listFiles(new FilenameFilter {
override def accept(dir: File, name: String): Boolean = {
name.toLowerCase.startsWith("hadoop-client") ||
name.toLowerCase.startsWith("flink-shaded-hadoop")
}
}).nonEmpty
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]