Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

[NSE-929] Support user defined spark extensions #930

Merged
merged 1 commit into from
Aug 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@ private[oap] class GazelleDriverPlugin extends DriverPlugin {
}

def setPredefinedConfigs(conf: SparkConf): Unit = {
if (conf.contains(SPARK_SESSION_EXTS_KEY)) {
throw new IllegalArgumentException("Spark extensions are already specified before " +
"enabling Gazelle plugin: " + conf.get(GazellePlugin.SPARK_SESSION_EXTS_KEY))
val extensions = conf.getOption(SPARK_SESSION_EXTS_KEY).getOrElse("")
if (extensions.contains(GAZELLE_SESSION_EXTENSION_NAME) ||
extensions.contains(GAZELLE_WRITE_SESSION_EXTENSION_NAME)) {
throw new IllegalArgumentException("Spark gazelle extensions are already specified before " +
"enabling Gazelle plugin: " + conf.get(GazellePlugin.SPARK_SESSION_EXTS_KEY))
}
conf.set(SPARK_SESSION_EXTS_KEY,
String.format("%s,%s", GAZELLE_SESSION_EXTENSION_NAME, GAZELLE_WRITE_SESSION_EXTENSION_NAME))
s"$GAZELLE_SESSION_EXTENSION_NAME,$GAZELLE_WRITE_SESSION_EXTENSION_NAME,$extensions")
}
}

Expand Down