Skip to content

Commit 0c5797a

Browse files
committed
[SPARK-53416][SS][TESTS] Use createOrReplaceTempView instead of registerTempTable in StreamingQueryOptimizationCorrectnessSuite
### What changes were proposed in this pull request? This pr aims to replace the deprecated API `registerTempTable` with `createOrReplaceTempView` in the `StreamingQueryOptimizationCorrectnessSuite`. Since `registerTempTable` has been deprecated since Spark 2.0.0, we should avoid using it outside of the `DeprecatedAPISuite`. ### Why are the changes needed? Clean up the usage of deprecated APIs ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? - Pass Github Actions ### Was this patch authored or co-authored using generative AI tooling? No Closes #52161 from LuciferYang/SPARK-53416. Authored-by: yangjie01 <[email protected]> Signed-off-by: yangjie01 <[email protected]>
1 parent 2de0248 commit 0c5797a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQueryOptimizationCorrectnessSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,11 +458,11 @@ class StreamingQueryOptimizationCorrectnessSuite extends StreamTest {
458458
withTempView("tv1", "tv2") {
459459
val inputStream1 = MemoryStream[Int]
460460
val ds1 = inputStream1.toDS()
461-
ds1.registerTempTable("tv1")
461+
ds1.createOrReplaceTempView("tv1")
462462

463463
val inputStream2 = MemoryStream[Int]
464464
val ds2 = inputStream2.toDS()
465-
ds2.registerTempTable("tv2")
465+
ds2.createOrReplaceTempView("tv2")
466466

467467
// DISTINCT is rewritten to AGGREGATE, hence an AGGREGATEs for each source
468468
val unioned = spark.sql(

0 commit comments

Comments
 (0)