From 1ac076dd6e8ea3347aa850071e78ba930bb46a71 Mon Sep 17 00:00:00 2001 From: Scott Sandre Date: Mon, 13 May 2024 11:46:29 -0700 Subject: [PATCH] Update DeltaSourceSuite.scala --- .../org/apache/spark/sql/delta/DeltaSourceSuite.scala | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spark/src/test/scala/org/apache/spark/sql/delta/DeltaSourceSuite.scala b/spark/src/test/scala/org/apache/spark/sql/delta/DeltaSourceSuite.scala index 6216169af49..e1dbcb09043 100644 --- a/spark/src/test/scala/org/apache/spark/sql/delta/DeltaSourceSuite.scala +++ b/spark/src/test/scala/org/apache/spark/sql/delta/DeltaSourceSuite.scala @@ -1733,7 +1733,7 @@ class DeltaSourceSuite extends DeltaSourceSuiteBase } } - testSparkLatestOnly("startingVersion: user defined start works with mergeSchema") { + test("startingVersion: user defined start works with mergeSchema") { withTempDir { inputDir => withTempView("startingVersionTest") { spark.range(10) @@ -1774,10 +1774,13 @@ class DeltaSourceSuite extends DeltaSourceSuiteBase q.processAllAvailable() checkAnswer( sql("select * from startingVersionTest"), - ((10 until 20).map(x => (x.toLong, x.toLong, None.toString)) ++ + ((10 until 20).map(x => (x.toLong, x.toLong, "null")) ++ (20 until 30).map(x => (x.toLong, x.toLong, x.toString))) .toDF("id", "id2", "id3") - .selectExpr("id", "id2", "cast(id3 as long) as id3") + .selectExpr( + "id", + "id2", + "CASE WHEN id3 = 'null' THEN NULL ELSE cast(id3 as long) END as id3") ) } finally { q.stop()