Skip to content

Commit 420728c

Browse files
committed
[SPARK-35579][SQL] Bump janino to 3.1.7
### What changes were proposed in this pull request? upgrade janino to 3.1.7 from 3.0.16 ### Why are the changes needed? - The proposed version contains bug fix in janino by maropu. - janino-compiler/janino#148 - contains `getBytecodes` method which can be used to simplify the way to get bytecodes from ClassBodyEvaluator in CodeGenerator#updateAndGetCompilationStats method. (by LuciferYang) - apache/spark#32536 ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Existing UTs Closes #37202 from singhpk234/upgrade/bump-janino. Authored-by: Prashant Singh <[email protected]> Signed-off-by: Sean Owen <[email protected]>
1 parent 7111f6e commit 420728c

File tree

36 files changed

+1801
-1324
lines changed

36 files changed

+1801
-1324
lines changed

connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/DB2IntegrationSuite.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,8 @@ class DB2IntegrationSuite extends DockerJDBCIntegrationV2Suite with V2JDBCTest {
106106
testStddevSamp(true)
107107
testCovarPop()
108108
testCovarSamp()
109+
testRegrIntercept()
110+
testRegrSlope()
111+
testRegrR2()
112+
testRegrSXY()
109113
}

connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/OracleIntegrationSuite.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,8 @@ class OracleIntegrationSuite extends DockerJDBCIntegrationV2Suite with V2JDBCTes
111111
testCovarPop()
112112
testCovarSamp()
113113
testCorr()
114+
testRegrIntercept()
115+
testRegrSlope()
116+
testRegrR2()
117+
testRegrSXY()
114118
}

connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/PostgresIntegrationSuite.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,12 @@ class PostgresIntegrationSuite extends DockerJDBCIntegrationV2Suite with V2JDBCT
104104
testCovarSamp(true)
105105
testCorr()
106106
testCorr(true)
107+
testRegrIntercept()
108+
testRegrIntercept(true)
109+
testRegrSlope()
110+
testRegrSlope(true)
111+
testRegrR2()
112+
testRegrR2(true)
113+
testRegrSXY()
114+
testRegrSXY(true)
107115
}

connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/V2JDBCTest.scala

Lines changed: 94 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -406,25 +406,27 @@ private[v2] trait V2JDBCTest extends SharedSparkSession with DockerIntegrationFu
406406

407407
protected def caseConvert(tableName: String): String = tableName
408408

409+
private def withOrWithout(isDistinct: Boolean): String = if (isDistinct) "with" else "without"
410+
409411
protected def testVarPop(isDistinct: Boolean = false): Unit = {
410412
val distinct = if (isDistinct) "DISTINCT " else ""
411-
test(s"scan with aggregate push-down: VAR_POP with distinct: $isDistinct") {
413+
test(s"scan with aggregate push-down: VAR_POP ${withOrWithout(isDistinct)} DISTINCT") {
412414
val df = sql(s"SELECT VAR_POP(${distinct}bonus) FROM $catalogAndNamespace." +
413415
s"${caseConvert("employee")} WHERE dept > 0 GROUP BY dept ORDER BY dept")
414416
checkFilterPushed(df)
415417
checkAggregateRemoved(df)
416418
checkAggregatePushed(df, "VAR_POP")
417419
val row = df.collect()
418420
assert(row.length === 3)
419-
assert(row(0).getDouble(0) === 10000d)
420-
assert(row(1).getDouble(0) === 2500d)
421-
assert(row(2).getDouble(0) === 0d)
421+
assert(row(0).getDouble(0) === 10000.0)
422+
assert(row(1).getDouble(0) === 2500.0)
423+
assert(row(2).getDouble(0) === 0.0)
422424
}
423425
}
424426

425427
protected def testVarSamp(isDistinct: Boolean = false): Unit = {
426428
val distinct = if (isDistinct) "DISTINCT " else ""
427-
test(s"scan with aggregate push-down: VAR_SAMP with distinct: $isDistinct") {
429+
test(s"scan with aggregate push-down: VAR_SAMP ${withOrWithout(isDistinct)} DISTINCT") {
428430
val df = sql(
429431
s"SELECT VAR_SAMP(${distinct}bonus) FROM $catalogAndNamespace." +
430432
s"${caseConvert("employee")} WHERE dept > 0 GROUP BY dept ORDER BY dept")
@@ -433,15 +435,15 @@ private[v2] trait V2JDBCTest extends SharedSparkSession with DockerIntegrationFu
433435
checkAggregatePushed(df, "VAR_SAMP")
434436
val row = df.collect()
435437
assert(row.length === 3)
436-
assert(row(0).getDouble(0) === 20000d)
437-
assert(row(1).getDouble(0) === 5000d)
438+
assert(row(0).getDouble(0) === 20000.0)
439+
assert(row(1).getDouble(0) === 5000.0)
438440
assert(row(2).isNullAt(0))
439441
}
440442
}
441443

442444
protected def testStddevPop(isDistinct: Boolean = false): Unit = {
443445
val distinct = if (isDistinct) "DISTINCT " else ""
444-
test(s"scan with aggregate push-down: STDDEV_POP with distinct: $isDistinct") {
446+
test(s"scan with aggregate push-down: STDDEV_POP ${withOrWithout(isDistinct)} DISTINCT") {
445447
val df = sql(
446448
s"SELECT STDDEV_POP(${distinct}bonus) FROM $catalogAndNamespace." +
447449
s"${caseConvert("employee")} WHERE dept > 0 GROUP BY dept ORDER BY dept")
@@ -450,15 +452,15 @@ private[v2] trait V2JDBCTest extends SharedSparkSession with DockerIntegrationFu
450452
checkAggregatePushed(df, "STDDEV_POP")
451453
val row = df.collect()
452454
assert(row.length === 3)
453-
assert(row(0).getDouble(0) === 100d)
454-
assert(row(1).getDouble(0) === 50d)
455-
assert(row(2).getDouble(0) === 0d)
455+
assert(row(0).getDouble(0) === 100.0)
456+
assert(row(1).getDouble(0) === 50.0)
457+
assert(row(2).getDouble(0) === 0.0)
456458
}
457459
}
458460

459461
protected def testStddevSamp(isDistinct: Boolean = false): Unit = {
460462
val distinct = if (isDistinct) "DISTINCT " else ""
461-
test(s"scan with aggregate push-down: STDDEV_SAMP with distinct: $isDistinct") {
463+
test(s"scan with aggregate push-down: STDDEV_SAMP ${withOrWithout(isDistinct)} DISTINCT") {
462464
val df = sql(
463465
s"SELECT STDDEV_SAMP(${distinct}bonus) FROM $catalogAndNamespace." +
464466
s"${caseConvert("employee")} WHERE dept > 0 GROUP BY dept ORDER BY dept")
@@ -467,15 +469,15 @@ private[v2] trait V2JDBCTest extends SharedSparkSession with DockerIntegrationFu
467469
checkAggregatePushed(df, "STDDEV_SAMP")
468470
val row = df.collect()
469471
assert(row.length === 3)
470-
assert(row(0).getDouble(0) === 141.4213562373095d)
471-
assert(row(1).getDouble(0) === 70.71067811865476d)
472+
assert(row(0).getDouble(0) === 141.4213562373095)
473+
assert(row(1).getDouble(0) === 70.71067811865476)
472474
assert(row(2).isNullAt(0))
473475
}
474476
}
475477

476478
protected def testCovarPop(isDistinct: Boolean = false): Unit = {
477479
val distinct = if (isDistinct) "DISTINCT " else ""
478-
test(s"scan with aggregate push-down: COVAR_POP with distinct: $isDistinct") {
480+
test(s"scan with aggregate push-down: COVAR_POP ${withOrWithout(isDistinct)} DISTINCT") {
479481
val df = sql(
480482
s"SELECT COVAR_POP(${distinct}bonus, bonus) FROM $catalogAndNamespace." +
481483
s"${caseConvert("employee")} WHERE dept > 0 GROUP BY dept ORDER BY dept")
@@ -484,15 +486,15 @@ private[v2] trait V2JDBCTest extends SharedSparkSession with DockerIntegrationFu
484486
checkAggregatePushed(df, "COVAR_POP")
485487
val row = df.collect()
486488
assert(row.length === 3)
487-
assert(row(0).getDouble(0) === 10000d)
488-
assert(row(1).getDouble(0) === 2500d)
489-
assert(row(2).getDouble(0) === 0d)
489+
assert(row(0).getDouble(0) === 10000.0)
490+
assert(row(1).getDouble(0) === 2500.0)
491+
assert(row(2).getDouble(0) === 0.0)
490492
}
491493
}
492494

493495
protected def testCovarSamp(isDistinct: Boolean = false): Unit = {
494496
val distinct = if (isDistinct) "DISTINCT " else ""
495-
test(s"scan with aggregate push-down: COVAR_SAMP with distinct: $isDistinct") {
497+
test(s"scan with aggregate push-down: COVAR_SAMP ${withOrWithout(isDistinct)} DISTINCT") {
496498
val df = sql(
497499
s"SELECT COVAR_SAMP(${distinct}bonus, bonus) FROM $catalogAndNamespace." +
498500
s"${caseConvert("employee")} WHERE dept > 0 GROUP BY dept ORDER BY dept")
@@ -501,15 +503,15 @@ private[v2] trait V2JDBCTest extends SharedSparkSession with DockerIntegrationFu
501503
checkAggregatePushed(df, "COVAR_SAMP")
502504
val row = df.collect()
503505
assert(row.length === 3)
504-
assert(row(0).getDouble(0) === 20000d)
505-
assert(row(1).getDouble(0) === 5000d)
506+
assert(row(0).getDouble(0) === 20000.0)
507+
assert(row(1).getDouble(0) === 5000.0)
506508
assert(row(2).isNullAt(0))
507509
}
508510
}
509511

510512
protected def testCorr(isDistinct: Boolean = false): Unit = {
511513
val distinct = if (isDistinct) "DISTINCT " else ""
512-
test(s"scan with aggregate push-down: CORR with distinct: $isDistinct") {
514+
test(s"scan with aggregate push-down: CORR ${withOrWithout(isDistinct)} DISTINCT") {
513515
val df = sql(
514516
s"SELECT CORR(${distinct}bonus, bonus) FROM $catalogAndNamespace." +
515517
s"${caseConvert("employee")} WHERE dept > 0 GROUP BY dept ORDER BY dept")
@@ -518,9 +520,77 @@ private[v2] trait V2JDBCTest extends SharedSparkSession with DockerIntegrationFu
518520
checkAggregatePushed(df, "CORR")
519521
val row = df.collect()
520522
assert(row.length === 3)
521-
assert(row(0).getDouble(0) === 1d)
522-
assert(row(1).getDouble(0) === 1d)
523+
assert(row(0).getDouble(0) === 1.0)
524+
assert(row(1).getDouble(0) === 1.0)
525+
assert(row(2).isNullAt(0))
526+
}
527+
}
528+
529+
protected def testRegrIntercept(isDistinct: Boolean = false): Unit = {
530+
val distinct = if (isDistinct) "DISTINCT " else ""
531+
test(s"scan with aggregate push-down: REGR_INTERCEPT ${withOrWithout(isDistinct)} DISTINCT") {
532+
val df = sql(
533+
s"SELECT REGR_INTERCEPT(${distinct}bonus, bonus) FROM $catalogAndNamespace." +
534+
s"${caseConvert("employee")} WHERE dept > 0 GROUP BY dept ORDER BY dept")
535+
checkFilterPushed(df)
536+
checkAggregateRemoved(df)
537+
checkAggregatePushed(df, "REGR_INTERCEPT")
538+
val row = df.collect()
539+
assert(row.length === 3)
540+
assert(row(0).getDouble(0) === 0.0)
541+
assert(row(1).getDouble(0) === 0.0)
542+
assert(row(2).isNullAt(0))
543+
}
544+
}
545+
546+
protected def testRegrSlope(isDistinct: Boolean = false): Unit = {
547+
val distinct = if (isDistinct) "DISTINCT " else ""
548+
test(s"scan with aggregate push-down: REGR_SLOPE ${withOrWithout(isDistinct)} DISTINCT") {
549+
val df = sql(
550+
s"SELECT REGR_SLOPE(${distinct}bonus, bonus) FROM $catalogAndNamespace." +
551+
s"${caseConvert("employee")} WHERE dept > 0 GROUP BY dept ORDER BY dept")
552+
checkFilterPushed(df)
553+
checkAggregateRemoved(df)
554+
checkAggregatePushed(df, "REGR_SLOPE")
555+
val row = df.collect()
556+
assert(row.length === 3)
557+
assert(row(0).getDouble(0) === 1.0)
558+
assert(row(1).getDouble(0) === 1.0)
559+
assert(row(2).isNullAt(0))
560+
}
561+
}
562+
563+
protected def testRegrR2(isDistinct: Boolean = false): Unit = {
564+
val distinct = if (isDistinct) "DISTINCT " else ""
565+
test(s"scan with aggregate push-down: REGR_R2 ${withOrWithout(isDistinct)} DISTINCT") {
566+
val df = sql(
567+
s"SELECT REGR_R2(${distinct}bonus, bonus) FROM $catalogAndNamespace." +
568+
s"${caseConvert("employee")} WHERE dept > 0 GROUP BY dept ORDER BY dept")
569+
checkFilterPushed(df)
570+
checkAggregateRemoved(df)
571+
checkAggregatePushed(df, "REGR_R2")
572+
val row = df.collect()
573+
assert(row.length === 3)
574+
assert(row(0).getDouble(0) === 1.0)
575+
assert(row(1).getDouble(0) === 1.0)
523576
assert(row(2).isNullAt(0))
524577
}
525578
}
579+
580+
protected def testRegrSXY(isDistinct: Boolean = false): Unit = {
581+
val distinct = if (isDistinct) "DISTINCT " else ""
582+
test(s"scan with aggregate push-down: REGR_SXY ${withOrWithout(isDistinct)} DISTINCT") {
583+
val df = sql(
584+
s"SELECT REGR_SXY(${distinct}bonus, bonus) FROM $catalogAndNamespace." +
585+
s"${caseConvert("employee")} WHERE dept > 0 GROUP BY dept ORDER BY dept")
586+
checkFilterPushed(df)
587+
checkAggregateRemoved(df)
588+
checkAggregatePushed(df, "REGR_SXY")
589+
val row = df.collect()
590+
assert(row.length === 3)
591+
assert(row(0).getDouble(0) === 20000.0)
592+
assert(row(1).getDouble(0) === 5000.0)
593+
assert(row(2).getDouble(0) === 0.0)
594+
}
595+
}
526596
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ commons-cli/1.5.0//commons-cli-1.5.0.jar
3939
commons-codec/1.15//commons-codec-1.15.jar
4040
commons-collections/3.2.2//commons-collections-3.2.2.jar
4141
commons-collections4/4.4//commons-collections4-4.4.jar
42-
commons-compiler/3.0.16//commons-compiler-3.0.16.jar
42+
commons-compiler/3.1.7//commons-compiler-3.1.7.jar
4343
commons-compress/1.21//commons-compress-1.21.jar
4444
commons-configuration/1.6//commons-configuration-1.6.jar
4545
commons-crypto/1.1.0//commons-crypto-1.1.0.jar
@@ -128,7 +128,7 @@ jakarta.servlet-api/4.0.3//jakarta.servlet-api-4.0.3.jar
128128
jakarta.validation-api/2.0.2//jakarta.validation-api-2.0.2.jar
129129
jakarta.ws.rs-api/2.1.6//jakarta.ws.rs-api-2.1.6.jar
130130
jakarta.xml.bind-api/2.3.2//jakarta.xml.bind-api-2.3.2.jar
131-
janino/3.0.16//janino-3.0.16.jar
131+
janino/3.1.7//janino-3.1.7.jar
132132
javassist/3.25.0-GA//javassist-3.25.0-GA.jar
133133
javax.inject/1//javax.inject-1.jar
134134
javax.jdo/3.2.0-m3//javax.jdo-3.2.0-m3.jar

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ commons-cli/1.5.0//commons-cli-1.5.0.jar
4040
commons-codec/1.15//commons-codec-1.15.jar
4141
commons-collections/3.2.2//commons-collections-3.2.2.jar
4242
commons-collections4/4.4//commons-collections4-4.4.jar
43-
commons-compiler/3.0.16//commons-compiler-3.0.16.jar
43+
commons-compiler/3.1.7//commons-compiler-3.1.7.jar
4444
commons-compress/1.21//commons-compress-1.21.jar
4545
commons-crypto/1.1.0//commons-crypto-1.1.0.jar
4646
commons-dbcp/1.4//commons-dbcp-1.4.jar
@@ -116,7 +116,7 @@ jakarta.servlet-api/4.0.3//jakarta.servlet-api-4.0.3.jar
116116
jakarta.validation-api/2.0.2//jakarta.validation-api-2.0.2.jar
117117
jakarta.ws.rs-api/2.1.6//jakarta.ws.rs-api-2.1.6.jar
118118
jakarta.xml.bind-api/2.3.2//jakarta.xml.bind-api-2.3.2.jar
119-
janino/3.0.16//janino-3.0.16.jar
119+
janino/3.1.7//janino-3.1.7.jar
120120
javassist/3.25.0-GA//javassist-3.25.0-GA.jar
121121
javax.jdo/3.2.0-m3//javax.jdo-3.2.0-m3.jar
122122
javolution/5.5.1//javolution-5.5.1.jar

dev/sparktestsupport/modules.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,7 @@ def __hash__(self):
647647
"pyspark.pandas.tests.test_resample",
648648
"pyspark.pandas.tests.test_reshape",
649649
"pyspark.pandas.tests.test_rolling",
650+
"pyspark.pandas.tests.test_scalars",
650651
"pyspark.pandas.tests.test_series_conversion",
651652
"pyspark.pandas.tests.test_series_datetime",
652653
"pyspark.pandas.tests.test_series_string",

docs/sql-ref-ansi-compliance.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ When ANSI mode is on, it throws exceptions for invalid operations. You can use t
319319
- `try_sum`: identical to the function `sum`, except that it returns `NULL` result instead of throwing an exception on integral/decimal/interval value overflow.
320320
- `try_avg`: identical to the function `avg`, except that it returns `NULL` result instead of throwing an exception on decimal/interval value overflow.
321321
- `try_element_at`: identical to the function `element_at`, except that it returns `NULL` result instead of throwing an exception on array's index out of bound or map's key not found.
322+
- `try_to_timestamp`: identical to the function `to_timestamp`, except that it returns `NULL` result instead of throwing an exception on string parsing error.
322323

323324
### SQL Keywords (optional, disabled by default)
324325

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
<commons-pool2.version>2.11.1</commons-pool2.version>
190190
<datanucleus-core.version>4.1.17</datanucleus-core.version>
191191
<guava.version>14.0.1</guava.version>
192-
<janino.version>3.0.16</janino.version>
192+
<janino.version>3.1.7</janino.version>
193193
<jersey.version>2.35</jersey.version>
194194
<joda.version>2.10.14</joda.version>
195195
<jodd.version>3.5.2</jodd.version>

python/docs/source/reference/pyspark.sql/data_types.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Data Types
4040
NullType
4141
ShortType
4242
StringType
43+
VarcharType
4344
StructField
4445
StructType
4546
TimestampType

0 commit comments

Comments
 (0)