Skip to content

Commit

Permalink
#139 Invoke .enableHiveSupport() when building the Spark session and …
Browse files Browse the repository at this point in the history
…Hive options are specified.
  • Loading branch information
yruslan committed Jan 26, 2023
1 parent b67de4f commit 6200fae
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,16 @@ object PipelineSparkSessionBuilder {
case (builder, (key, value)) => builder.config(key, value)
}

val spark = sparkSessionBuilderWithExtraOptApplied.getOrCreate()
val isHiveSupportRequired = extraOptions.exists(_._1.contains("hive"))

val spark = if (isHiveSupportRequired) {
sparkSessionBuilderWithExtraOptApplied
.enableHiveSupport()
.getOrCreate()
} else {
sparkSessionBuilderWithExtraOptApplied
.getOrCreate()
}

applyHadoopConfig(spark, conf)
}
Expand Down

0 comments on commit 6200fae

Please sign in to comment.