Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
longvu-db committed Sep 20, 2024
1 parent 63c3dd1 commit 66dbfa8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,13 @@ class DeltaMergeMatchedActionBuilder private(
}
}

/**
* Converts a map of strings to expressions as SQL formatted string
* into a map of strings to Column objects.
*
* @param map A map where the value is an expression as SQL formatted string.
* @return A map where the value is a Column object created from the expression.
*/
private def toStrColumnMap(map: Map[String, String]): Map[String, Column] =
map.mapValues(functions.expr).toMap
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ class DeltaConnectPlannerSuite
)

val plan = transform(input)
assert(plan.columns.toSeq === V2CommandOutputs.mergeOutput.map(_.name))
val result = Dataset.ofRows(spark, plan).collect()
assert(result.length === 1)
assert(result.head.getLong(0) === 50) // num_affected_rows
Expand Down Expand Up @@ -531,7 +530,6 @@ class DeltaConnectPlannerSuite
)

val plan = transform(input)
assert(plan.columns.toSeq === V2CommandOutputs.mergeOutput.map(_.name))
val result = Dataset.ofRows(spark, plan).collect()
assert(result.length === 1)
assert(result.head.getLong(0) === 50) // num_affected_rows
Expand Down Expand Up @@ -582,7 +580,6 @@ class DeltaConnectPlannerSuite
)

val plan = transform(input)
assert(plan.columns.toSeq === V2CommandOutputs.mergeOutput.map(_.name))
val result = Dataset.ofRows(spark, plan).collect()
assert(result.length === 1)
assert(result.head.getLong(0) === 125) // num_affected_rows
Expand Down Expand Up @@ -635,9 +632,7 @@ class DeltaConnectPlannerSuite
)
)

val plan = new SparkConnectPlanner(
SparkConnectTestUtils.createDummySessionHolder(spark)).transformRelation(input)
assert(plan.columns.toSeq === V2CommandOutputs.mergeOutput.map(_.name))
val plan = transform(input)
val result = Dataset.ofRows(spark, plan).collect()
assert(result.length === 1)
assert(result.head.getLong(0) === 125) // num_affected_rows
Expand Down Expand Up @@ -690,9 +685,7 @@ class DeltaConnectPlannerSuite
)
)

val plan = new SparkConnectPlanner(
SparkConnectTestUtils.createDummySessionHolder(spark)).transformRelation(input)
assert(plan.columns.toSeq === V2CommandOutputs.mergeOutput.map(_.name))
val plan = transform(input)
val result = Dataset.ofRows(spark, plan).collect()
assert(result.length === 1)
assert(result.head.getLong(0) === 125) // num_affected_rows
Expand Down

0 comments on commit 66dbfa8

Please sign in to comment.