This is an automated email from the ASF dual-hosted git repository.
gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 44ffe9089bc [MINOR][SQL][TESTS] Use SystemUtils.isJavaVersionAtMost
for java version check
44ffe9089bc is described below
commit 44ffe9089bce724164fd05ebc26d9e9fdb7f0480
Author: Hyukjin Kwon <[email protected]>
AuthorDate: Mon Jul 3 13:01:17 2023 +0900
[MINOR][SQL][TESTS] Use SystemUtils.isJavaVersionAtMost for java version
check
### What changes were proposed in this pull request?
This PR proposes to use Apache Common API for proper Java version checking
instead of manual check via `System.getProperty("java.version")`.
### Why are the changes needed?
To have the consistent codebase. This is the only place left.
### Does this PR introduce _any_ user-facing change?
No, with/without this change virtually same.
### How was this patch tested?
Manually tested.
Closes #41822 from HyukjinKwon/minor-java-string.
Authored-by: Hyukjin Kwon <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
---
.../org/apache/spark/sql/catalyst/util/TimestampFormatterSuite.scala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/TimestampFormatterSuite.scala
b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/TimestampFormatterSuite.scala
index 8f6099e96ef..e050a6d1789 100644
---
a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/TimestampFormatterSuite.scala
+++
b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/TimestampFormatterSuite.scala
@@ -412,7 +412,7 @@ class TimestampFormatterSuite extends
DatetimeFormatterSuite {
assert(formatter.format(date(1970, 1, 3)) == "03")
assert(formatter.format(date(1970, 4, 9)) == "99")
- if (System.getProperty("java.version").split("\\D+")(0).toInt < 9) {
+ if (SystemUtils.isJavaVersionAtMost(JavaVersion.JAVA_1_8)) {
// https://bugs.openjdk.java.net/browse/JDK-8079628
intercept[SparkUpgradeException] {
formatter.format(date(1970, 4, 10))
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]