Skip to content

Commit 4b97009

Browse files
HeartSaVioRdongjoon-hyun
authored andcommitted
[SPARK-31101][BUILD][3.0] Upgrade Janino to 3.0.16
### What changes were proposed in this pull request? This PR(SPARK-31101) proposes to upgrade Janino to 3.0.16 which is released recently. * Merged pull request janino-compiler/janino#114 "Grow the code for relocatables, and do fixup, and relocate". Please see the commit log. - https://github.com/janino-compiler/janino/commits/3.0.16 You can see the changelog from the link: http://janino-compiler.github.io/janino/changelog.html / though release note for Janino 3.0.16 is actually incorrect. ### Why are the changes needed? We got some report on failure on user's query which Janino throws error on compiling generated code. The issue is here: janino-compiler/janino#113 It contains the information of generated code, symptom (error), and analysis of the bug, so please refer the link for more details. Janino 3.0.16 contains the PR janino-compiler/janino#114 which would enable Janino to succeed to compile user's query properly. ### Does this PR introduce any user-facing change? No. ### How was this patch tested? Existing UTs. Below test code fails on branch-3.0 and passes with this patch. ``` /** * NOTE: The test code tries to control the size of for/switch statement in expand_doConsume, * as well as the overall size of expand_doConsume, so that the query triggers known Janino * bug - janino-compiler/janino#113. * * The expected exception message from Janino when we use switch statement for "ExpandExec": * - "Operand stack inconsistent at offset xxx: Previous size 1, now 0" * which will not happen when we use if-else-if statement for "ExpandExec". * * "The number of fields" and "The number of distinct aggregation functions" are the major * factors to increase the size of generated code: while these values should be large enough * to trigger the Janino bug, these values should not also too big; otherwise one of below * exceptions might be thrown: * - "expand_doConsume would be beyond 64KB" * - "java.lang.ClassFormatError: Too many arguments in method signature in class file" */ test("SPARK-31115 Lots of columns and distinct aggregations shouldn't break code generation") { withSQLConf( (SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key, "true"), (SQLConf.WHOLESTAGE_MAX_NUM_FIELDS.key, "10000"), (SQLConf.CODEGEN_FALLBACK.key, "false"), (SQLConf.CODEGEN_LOGGING_MAX_LINES.key, "-1") ) { var df = Seq(("1", "2", 1), ("1", "2", 2), ("2", "3", 3), ("2", "3", 4)).toDF("a", "b", "c") // The value is tested under commit "e807118eef9e0214170ff62c828524d237bd58e3": // the query fails with switch statement, whereas it passes with if-else statement. // Note that the value depends on the Spark logic as well - different Spark versions may // require different value to ensure the test failing with switch statement. val numNewFields = 100 df = df.withColumns( (1 to numNewFields).map { idx => s"a$idx" }, (1 to numNewFields).map { idx => when(col("c").mod(lit(2)).===(lit(0)), lit(idx)).otherwise(col("c")) } ) val aggExprs: Array[Column] = Range(1, numNewFields).map { idx => if (idx % 2 == 0) { coalesce(countDistinct(s"a$idx"), lit(0)) } else { coalesce(count(s"a$idx"), lit(0)) } }.toArray val aggDf = df .groupBy("a", "b") .agg(aggExprs.head, aggExprs.tail: _*) // We are only interested in whether the code compilation fails or not, so skipping // verification on outputs. aggDf.collect() } } ``` Closes #27996 from HeartSaVioR/SPARK-31101-branch-3.0. Authored-by: Jungtaek Lim (HeartSaVioR) <kabhwan.opensource@gmail.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
1 parent d278960 commit 4b97009

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ commons-beanutils/1.9.4//commons-beanutils-1.9.4.jar
3535
commons-cli/1.2//commons-cli-1.2.jar
3636
commons-codec/1.10//commons-codec-1.10.jar
3737
commons-collections/3.2.2//commons-collections-3.2.2.jar
38-
commons-compiler/3.0.15//commons-compiler-3.0.15.jar
38+
commons-compiler/3.0.16//commons-compiler-3.0.16.jar
3939
commons-compress/1.8.1//commons-compress-1.8.1.jar
4040
commons-configuration/1.6//commons-configuration-1.6.jar
4141
commons-crypto/1.0.0//commons-crypto-1.0.0.jar
@@ -105,7 +105,7 @@ jakarta.inject/2.6.1//jakarta.inject-2.6.1.jar
105105
jakarta.validation-api/2.0.2//jakarta.validation-api-2.0.2.jar
106106
jakarta.ws.rs-api/2.1.6//jakarta.ws.rs-api-2.1.6.jar
107107
jakarta.xml.bind-api/2.3.2//jakarta.xml.bind-api-2.3.2.jar
108-
janino/3.0.15//janino-3.0.15.jar
108+
janino/3.0.16//janino-3.0.16.jar
109109
javassist/3.25.0-GA//javassist-3.25.0-GA.jar
110110
javax.inject/1//javax.inject-1.jar
111111
javax.servlet-api/3.1.0//javax.servlet-api-3.1.0.jar

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ commons-beanutils/1.9.4//commons-beanutils-1.9.4.jar
3333
commons-cli/1.2//commons-cli-1.2.jar
3434
commons-codec/1.10//commons-codec-1.10.jar
3535
commons-collections/3.2.2//commons-collections-3.2.2.jar
36-
commons-compiler/3.0.15//commons-compiler-3.0.15.jar
36+
commons-compiler/3.0.16//commons-compiler-3.0.16.jar
3737
commons-compress/1.8.1//commons-compress-1.8.1.jar
3838
commons-configuration/1.6//commons-configuration-1.6.jar
3939
commons-crypto/1.0.0//commons-crypto-1.0.0.jar
@@ -118,7 +118,7 @@ jakarta.inject/2.6.1//jakarta.inject-2.6.1.jar
118118
jakarta.validation-api/2.0.2//jakarta.validation-api-2.0.2.jar
119119
jakarta.ws.rs-api/2.1.6//jakarta.ws.rs-api-2.1.6.jar
120120
jakarta.xml.bind-api/2.3.2//jakarta.xml.bind-api-2.3.2.jar
121-
janino/3.0.15//janino-3.0.15.jar
121+
janino/3.0.16//janino-3.0.16.jar
122122
javassist/3.25.0-GA//javassist-3.25.0-GA.jar
123123
javax.inject/1//javax.inject-1.jar
124124
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
@@ -30,7 +30,7 @@ commons-beanutils/1.9.4//commons-beanutils-1.9.4.jar
3030
commons-cli/1.2//commons-cli-1.2.jar
3131
commons-codec/1.10//commons-codec-1.10.jar
3232
commons-collections/3.2.2//commons-collections-3.2.2.jar
33-
commons-compiler/3.0.15//commons-compiler-3.0.15.jar
33+
commons-compiler/3.0.16//commons-compiler-3.0.16.jar
3434
commons-compress/1.8.1//commons-compress-1.8.1.jar
3535
commons-configuration2/2.1.1//commons-configuration2-2.1.1.jar
3636
commons-crypto/1.0.0//commons-crypto-1.0.0.jar
@@ -117,7 +117,7 @@ jakarta.inject/2.6.1//jakarta.inject-2.6.1.jar
117117
jakarta.validation-api/2.0.2//jakarta.validation-api-2.0.2.jar
118118
jakarta.ws.rs-api/2.1.6//jakarta.ws.rs-api-2.1.6.jar
119119
jakarta.xml.bind-api/2.3.2//jakarta.xml.bind-api-2.3.2.jar
120-
janino/3.0.15//janino-3.0.15.jar
120+
janino/3.0.16//janino-3.0.16.jar
121121
javassist/3.25.0-GA//javassist-3.25.0-GA.jar
122122
javax.inject/1//javax.inject-1.jar
123123
javax.jdo/3.2.0-m3//javax.jdo-3.2.0-m3.jar

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
<!-- org.apache.commons/commons-pool2/-->
179179
<commons-pool2.version>2.6.2</commons-pool2.version>
180180
<datanucleus-core.version>4.1.17</datanucleus-core.version>
181-
<janino.version>3.0.15</janino.version>
181+
<janino.version>3.0.16</janino.version>
182182
<jersey.version>2.30</jersey.version>
183183
<joda.version>2.10.5</joda.version>
184184
<jodd.version>3.5.2</jodd.version>

0 commit comments

Comments
 (0)