Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Revert "Revert changes drop duplicates"
This reverts commit 9850345.
  • Loading branch information
MaxGekk committed Jan 11, 2024
commit 60dda6cde440660bf278a823ac2de4397be09e01
18 changes: 7 additions & 11 deletions sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3103,11 +3103,9 @@ class Dataset[T] private[sql](
* @group typedrel
* @since 2.0.0
*/
def dropDuplicates(colNames: Seq[String]): Dataset[T] = withOrigin {
withTypedPlan {
val groupCols = groupColsFromDropDuplicates(colNames)
Deduplicate(groupCols, logicalPlan)
}
def dropDuplicates(colNames: Seq[String]): Dataset[T] = withTypedPlan {
val groupCols = groupColsFromDropDuplicates(colNames)
Deduplicate(groupCols, logicalPlan)
}

/**
Expand Down Expand Up @@ -3184,12 +3182,10 @@ class Dataset[T] private[sql](
* @group typedrel
* @since 3.5.0
*/
def dropDuplicatesWithinWatermark(colNames: Seq[String]): Dataset[T] = withOrigin {
withTypedPlan {
val groupCols = groupColsFromDropDuplicates(colNames)
// UnsupportedOperationChecker will fail the query if this is called with batch Dataset.
DeduplicateWithinWatermark(groupCols, logicalPlan)
}
def dropDuplicatesWithinWatermark(colNames: Seq[String]): Dataset[T] = withTypedPlan {
val groupCols = groupColsFromDropDuplicates(colNames)
// UnsupportedOperationChecker will fail the query if this is called with batch Dataset.
DeduplicateWithinWatermark(groupCols, logicalPlan)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,7 @@ class DataFrameSetOperationsSuite extends QueryTest
errorClass = "UNSUPPORTED_FEATURE.SET_OPERATION_ON_MAP_TYPE",
parameters = Map(
"colName" -> "`m`",
"dataType" -> "\"MAP<STRING, BIGINT>\""),
context = ExpectedContext(
fragment = "distinct",
callSitePattern = getCurrentClassCallSitePattern)
)
"dataType" -> "\"MAP<STRING, BIGINT>\""))
withTempView("v") {
df.createOrReplaceTempView("v")
checkError(
Expand Down