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
Move test case to SparkPlanSuite
  • Loading branch information
HyukjinKwon committed Jul 20, 2018
commit be6e5941991ca045100456e11a59a9b2eb77a1ea

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.spark.sql.execution

import org.apache.spark.SparkEnv
import org.apache.spark.sql.QueryTest
import org.apache.spark.sql.test.SharedSQLContext

Expand All @@ -33,4 +34,20 @@ class SparkPlanSuite extends QueryTest with SharedSQLContext {
intercept[IllegalStateException] { plan.executeTake(1) }
}

test("SPARK-23731 plans should be canonicalizable after being (de)serialized") {
withTempPath { path =>
spark.range(1).write.parquet(path.getAbsolutePath)
val df = spark.read.parquet(path.getAbsolutePath)
val fileSourceScanExec =
df.queryExecution.sparkPlan.collectFirst { case p: FileSourceScanExec => p }.get
val serializer = SparkEnv.get.serializer.newInstance()
val readback =
serializer.deserialize[FileSourceScanExec](serializer.serialize(fileSourceScanExec))
try {
readback.canonicalized
} catch {
case e: Throwable => fail("FileSourceScanExec was not canonicalizable", e)
}
}
}
}