Skip to content

Commit

Permalink
Extra options should overwrite session options in save
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxGekk committed Sep 13, 2018
1 parent 13729b5 commit 14498fb
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,13 @@ final class DataFrameWriter[T] private[sql](ds: Dataset[T]) {
val source = cls.newInstance().asInstanceOf[DataSourceV2]
source match {
case provider: BatchWriteSupportProvider =>
val options = extraOptions ++
DataSourceV2Utils.extractSessionConfigs(source, df.sparkSession.sessionState.conf)
val sessionOptions = DataSourceV2Utils.extractSessionConfigs(
source,
df.sparkSession.sessionState.conf)
val options = sessionOptions ++ extraOptions

val relation = DataSourceV2Relation.create(source, options.toMap)

val relation = DataSourceV2Relation.create(source, options)
if (mode == SaveMode.Append) {
runCommand(df.sparkSession, "save") {
AppendData.byName(relation, df.logicalPlan)
Expand Down

0 comments on commit 14498fb

Please sign in to comment.