Skip to content

Commit 101b0cc

Browse files
maropusrowen
authored andcommitted
[SPARK-35253][SQL][BUILD] Bump up the janino version to v3.1.4
### What changes were proposed in this pull request? This PR proposes to bump up the janino version from 3.0.16 to v3.1.4. The major changes of this upgrade are as follows: - Fixed issue apache#131: Janino 3.1.2 is 10x slower than 3.0.11: The Compiler's IClassLoader was initialized way too eagerly, thus lots of classes were loaded from the class path, which is very slow. - Improved the encoding of stack map frames according to JVMS11 4.7.4: Previously, only "full_frame"s were generated. - Fixed issue apache#107: Janino requires "org.codehaus.commons.compiler.io", but commons-compiler does not export this package - Fixed the promotion of the array access index expression (see JLS7 15.13 Array Access Expressions). For all the changes, please see the change log: http://janino-compiler.github.io/janino/changelog.html NOTE1: I've checked that there is no obvious performance regression. For all the data, see a link: https://docs.google.com/spreadsheets/d/1srxT9CioGQg1fLKM3Uo8z1sTzgCsMj4pg6JzpdcG6VU/edit?usp=sharing NOTE2: We upgraded janino to 3.1.2 (apache#27860) once before, but the commit had been reverted in apache#29495 because of the correctness issue. Recently, apache#32374 had checked if Spark could land on v3.1.3 or not, but a new bug was found there. These known issues has been fixed in v3.1.4 by following PRs: - janino-compiler/janino#145 - janino-compiler/janino#146 ### Why are the changes needed? janino v3.0.X is no longer maintained. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? GA passed. Closes apache#32455 from maropu/janino_v3.1.4. Authored-by: Takeshi Yamamuro <[email protected]> Signed-off-by: Sean Owen <[email protected]>
1 parent 402375b commit 101b0cc

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

dev/deps/spark-deps-hadoop-2.7-hive-2.3

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ commons-beanutils/1.9.4//commons-beanutils-1.9.4.jar
3737
commons-cli/1.2//commons-cli-1.2.jar
3838
commons-codec/1.15//commons-codec-1.15.jar
3939
commons-collections/3.2.2//commons-collections-3.2.2.jar
40-
commons-compiler/3.0.16//commons-compiler-3.0.16.jar
40+
commons-compiler/3.1.4//commons-compiler-3.1.4.jar
4141
commons-compress/1.20//commons-compress-1.20.jar
4242
commons-configuration/1.6//commons-configuration-1.6.jar
4343
commons-crypto/1.1.0//commons-crypto-1.1.0.jar
@@ -122,7 +122,7 @@ jakarta.servlet-api/4.0.3//jakarta.servlet-api-4.0.3.jar
122122
jakarta.validation-api/2.0.2//jakarta.validation-api-2.0.2.jar
123123
jakarta.ws.rs-api/2.1.6//jakarta.ws.rs-api-2.1.6.jar
124124
jakarta.xml.bind-api/2.3.2//jakarta.xml.bind-api-2.3.2.jar
125-
janino/3.0.16//janino-3.0.16.jar
125+
janino/3.1.4//janino-3.1.4.jar
126126
javassist/3.25.0-GA//javassist-3.25.0-GA.jar
127127
javax.inject/1//javax.inject-1.jar
128128
javax.jdo/3.2.0-m3//javax.jdo-3.2.0-m3.jar

dev/deps/spark-deps-hadoop-3.2-hive-2.3

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ chill_2.12/0.9.5//chill_2.12-0.9.5.jar
3131
commons-cli/1.2//commons-cli-1.2.jar
3232
commons-codec/1.15//commons-codec-1.15.jar
3333
commons-collections/3.2.2//commons-collections-3.2.2.jar
34-
commons-compiler/3.0.16//commons-compiler-3.0.16.jar
34+
commons-compiler/3.1.4//commons-compiler-3.1.4.jar
3535
commons-compress/1.20//commons-compress-1.20.jar
3636
commons-crypto/1.1.0//commons-crypto-1.1.0.jar
3737
commons-dbcp/1.4//commons-dbcp-1.4.jar
@@ -98,7 +98,7 @@ jakarta.servlet-api/4.0.3//jakarta.servlet-api-4.0.3.jar
9898
jakarta.validation-api/2.0.2//jakarta.validation-api-2.0.2.jar
9999
jakarta.ws.rs-api/2.1.6//jakarta.ws.rs-api-2.1.6.jar
100100
jakarta.xml.bind-api/2.3.2//jakarta.xml.bind-api-2.3.2.jar
101-
janino/3.0.16//janino-3.0.16.jar
101+
janino/3.1.4//janino-3.1.4.jar
102102
javassist/3.25.0-GA//javassist-3.25.0-GA.jar
103103
javax.jdo/3.2.0-m3//javax.jdo-3.2.0-m3.jar
104104
javolution/5.5.1//javolution-5.5.1.jar

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
<commons-pool2.version>2.6.2</commons-pool2.version>
185185
<datanucleus-core.version>4.1.17</datanucleus-core.version>
186186
<guava.version>14.0.1</guava.version>
187-
<janino.version>3.0.16</janino.version>
187+
<janino.version>3.1.4</janino.version>
188188
<jersey.version>2.34</jersey.version>
189189
<joda.version>2.10.5</joda.version>
190190
<jodd.version>3.5.2</jodd.version>

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ import scala.util.control.NonFatal
2727

2828
import com.google.common.cache.{CacheBuilder, CacheLoader}
2929
import com.google.common.util.concurrent.{ExecutionError, UncheckedExecutionException}
30-
import org.codehaus.commons.compiler.CompileException
31-
import org.codehaus.janino.{ByteArrayClassLoader, ClassBodyEvaluator, InternalCompilerException, SimpleCompiler}
30+
import org.codehaus.commons.compiler.{CompileException, InternalCompilerException}
31+
import org.codehaus.commons.compiler.util.reflect.ByteArrayClassLoader
32+
import org.codehaus.janino.{ClassBodyEvaluator, SimpleCompiler}
3233
import org.codehaus.janino.util.ClassFile
3334

3435
import org.apache.spark.{TaskContext, TaskKilledException}
@@ -1434,9 +1435,10 @@ object CodeGenerator extends Logging {
14341435
private def updateAndGetCompilationStats(evaluator: ClassBodyEvaluator): ByteCodeStats = {
14351436
// First retrieve the generated classes.
14361437
val classes = {
1437-
val resultField = classOf[SimpleCompiler].getDeclaredField("result")
1438-
resultField.setAccessible(true)
1439-
val loader = resultField.get(evaluator).asInstanceOf[ByteArrayClassLoader]
1438+
val scField = classOf[ClassBodyEvaluator].getDeclaredField("sc")
1439+
scField.setAccessible(true)
1440+
val compiler = scField.get(evaluator).asInstanceOf[SimpleCompiler]
1441+
val loader = compiler.getClassLoader.asInstanceOf[ByteArrayClassLoader]
14401442
val classesField = loader.getClass.getDeclaredField("classes")
14411443
classesField.setAccessible(true)
14421444
classesField.get(loader).asInstanceOf[JavaMap[String, Array[Byte]]].asScala

sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ import java.time.{DateTimeException, LocalDate}
2424
import java.time.temporal.ChronoField
2525

2626
import org.apache.hadoop.fs.{FileStatus, Path}
27-
import org.codehaus.commons.compiler.CompileException
28-
import org.codehaus.janino.InternalCompilerException
27+
import org.codehaus.commons.compiler.{CompileException, InternalCompilerException}
2928

3029
import org.apache.spark.{Partition, SparkException, SparkUpgradeException}
3130
import org.apache.spark.executor.CommitDeniedException

0 commit comments

Comments
 (0)