Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
szehon-ho committed Sep 16, 2024
1 parent 45369c7 commit 42e73e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,7 @@ object CheckConnectJvmClientCompatibility {
ProblemFilters.exclude[DirectMissingMethodProblem](
"org.apache.spark.sql.DataFrameReader.validateJsonSchema"),
ProblemFilters.exclude[DirectMissingMethodProblem](
"org.apache.spark.sql.DataFrameReader.validateXmlSchema"),

// Update Writer
ProblemFilters.exclude[MissingMethodProblem]("org.apache.spark.sql.SparkSession.update"))
"org.apache.spark.sql.DataFrameReader.validateXmlSchema")

checkMiMaCompatibility(clientJar, sqlJar, includedRules, excludeRules)
}
Expand Down
11 changes: 6 additions & 5 deletions sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1656,13 +1656,12 @@ class Dataset[T] private[sql](
}

/**
* Update rows in a table.
* Update rows in a table. Only applies to Datasets that are direct table scans.
*
* Scala Example:
* {{{
* spark.table("source")
* .update(Map("salary" -> lit(200)))
* .execute()
* }}}
* @param assignments A Map of column names to Column expressions representing the updates
* to be applied.
Expand All @@ -1674,21 +1673,23 @@ class Dataset[T] private[sql](
}

/**
* Update rows in a table that match a condition.
* Update rows in a table that match a condition. Only applies to Datasets that are
* direct table scans.
*
* Scala Example:
* {{{
* spark.table("source")
* .update(Map("salary" -> lit(200)), $"salary" === 100)
* .execute()
* }}}
* @param assignments A Map of column names to Column expressions representing the updates
* to be applied.
* @param condition the update condition
* @group basic
* @since 4.0.0
*/
def update(assignments: Map[String, Column], condition: Column): Unit = {
def update(
assignments: Map[String, Column],
condition: Column): Unit = {
updateInternal(assignments, Some(condition))
}

Expand Down

0 comments on commit 42e73e6

Please sign in to comment.