Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/19687#discussion_r149627183
--- Diff:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoderSuite.scala
---
@@ -441,4 +443,28 @@ class ExpressionEncoderSuite extends PlanTest with
AnalysisTest {
}
}
}
+
+ /**
+ * Verify the size of scala.reflect.runtime.JavaUniverse.undoLog before
and after `func` to
+ * ensure we don't leak Scala reflection garbage.
+ *
+ * @see
org.apache.spark.sql.catalyst.ScalaReflection.cleanUpReflectionObjects
+ */
+ private def verifyNotLeakingReflectionObjects[T](func: => T): T = {
+ def undoLogSize: Int = {
+ import scala.reflect.runtime.{JavaUniverse, universe}
--- End diff --
Just out of curiosity why import here, and for one usage in the line below?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]