maropu commented on a change in pull request #32536:
URL: https://github.com/apache/spark/pull/32536#discussion_r632163220
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
##########
@@ -1434,15 +1432,7 @@ object CodeGenerator extends Logging {
*/
private def updateAndGetCompilationStats(evaluator: ClassBodyEvaluator):
ByteCodeStats = {
// First retrieve the generated classes.
- val classes = {
- val scField = classOf[ClassBodyEvaluator].getDeclaredField("sc")
- scField.setAccessible(true)
- val compiler = scField.get(evaluator).asInstanceOf[SimpleCompiler]
- val loader = compiler.getClassLoader.asInstanceOf[ByteArrayClassLoader]
- val classesField = loader.getClass.getDeclaredField("classes")
- classesField.setAccessible(true)
- classesField.get(loader).asInstanceOf[JavaMap[String,
Array[Byte]]].asScala
- }
+ val classes = evaluator.getBytecodes.asScala
Review comment:
It seems fine, but have you checked if this stat value does not change
before/after this PR?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]