Skip to content

Commit b539c7b

Browse files
committed
For comment.
1 parent 72f35b1 commit b539c7b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,10 +457,14 @@ class DataFrameSuite extends QueryTest {
457457
Row(key, value, key + 1)
458458
}.toSeq)
459459
assert(df.schema.map(_.name).toSeq === Seq("key", "value", "newCol"))
460+
}
460461

462+
test("replace column using withColumn") {
461463
val df2 = TestSQLContext.sparkContext.parallelize(Array(1, 2, 3)).toDF("x")
462464
val df3 = df2.withColumn("x", df2("x") + 1)
463-
assert(df3.select("x").collect().toSeq === Seq(Row(2), Row(3), Row(4)))
465+
checkAnswer(
466+
df3.select("x"),
467+
Row(2) :: Row(3) :: Row(4) :: Nil)
464468
}
465469

466470
test("withColumnRenamed") {

0 commit comments

Comments
 (0)