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

Commit

Permalink
support user spark extensions (#930)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackylee-ch authored Aug 11, 2022
1 parent ef95b1d commit 9567587
Showing 1 changed file with 6 additions and 4 deletions.
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

0 comments on commit 9567587

Please sign in to comment.