You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "LuciferYang (via GitHub)" <gi...@apache.org> on 2023/12/21 11:35:23 UTC
[PR] [SPARK-46479][CORE] Change `Utils.isJavaVersionAtLeast21` to use the utility method from `commons-lang3` [spark]
LuciferYang opened a new pull request, #44444:
URL: https://github.com/apache/spark/pull/44444
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a faster review.
7. If you want to add a new configuration, please read the guideline first for naming configurations in
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
8. If you want to add or modify an error type or message, please read the guideline first in
'core/src/main/resources/error/README.md'.
-->
### What changes were proposed in this pull request?
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->
### Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
-->
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
If no, write 'No'.
-->
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
-->
### Was this patch authored or co-authored using generative AI tooling?
<!--
If generative AI tooling has been used in the process of authoring this patch, please include the
phrase: 'Generated-by: ' followed by the name of the tool and its version.
If no, write 'No'.
Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
-->
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46479][CORE] Change `Utils.isJavaVersionAtLeast21` to use the utility method from `commons-lang3` [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on code in PR #44444:
URL: https://github.com/apache/spark/pull/44444#discussion_r1434693808
##########
project/SparkBuild.scala:
##########
@@ -1373,6 +1373,7 @@ object Unidoc {
classpaths
.map(_.filterNot(_.data.getCanonicalPath.matches(""".*kafka-clients-0\.10.*""")))
.map(_.filterNot(_.data.getCanonicalPath.matches(""".*kafka_2\..*-0\.10.*""")))
+ .map(_.filterNot(_.data.getCanonicalPath.contains("apache-rat")))
Review Comment:
The following contents have been shaded in apache-rat-0.14.jar, but none of them have been relocated:
```
org.apache.commons:commons-collections4:jar:4.4
org.apache.commons:commons-lang3:jar:3.12.0
commons-io:commons-io:jar:2.11.0
org.apache.commons:commons-compress:jar:1.25.0
commons-cli:commons-cli:jar:1.5.0
```
Since `apache-rat` is not a direct dependency of the project, it was manually downloaded in `check-license`, I did not find a way to exclude it through `DependencyOverrides` or `ExcludedDependencies`.
Another possible simple solution is to change `build_and_test.yml`, manually delete `./lib/apache-rat-*.jar` after executing `check-license`.
@HyukjinKwon @yaooqinn @MaxGekk WDYT?
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46479][CORE] Change `Utils.isJavaVersionAtLeast21` to use the utility method from `commons-lang3` [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on code in PR #44444:
URL: https://github.com/apache/spark/pull/44444#discussion_r1434693808
##########
project/SparkBuild.scala:
##########
@@ -1373,6 +1373,7 @@ object Unidoc {
classpaths
.map(_.filterNot(_.data.getCanonicalPath.matches(""".*kafka-clients-0\.10.*""")))
.map(_.filterNot(_.data.getCanonicalPath.matches(""".*kafka_2\..*-0\.10.*""")))
+ .map(_.filterNot(_.data.getCanonicalPath.contains("apache-rat")))
Review Comment:
The following contents have been shaded in apache-rat-0.14.jar, but none of them have been relocated:
```
org.apache.commons:commons-collections4:jar:4.4
org.apache.commons:commons-lang3:jar:3.12.0
commons-io:commons-io:jar:2.11.0
org.apache.commons:commons-compress:jar:1.25.0
commons-cli:commons-cli:jar:1.5.0
```
Since `apache-rat` is not a direct dependency of the project, it was manually downloaded in `check-license`, I did not find a way to exclude it through `DependencyOverrides` or `ExcludedDependencies`.
Another possible simple solution is to change `build_and_test.yml`, manually delete `./lib/apache-rat-*.jar` after executing `check-license`.
@HyukjinKwon WDYT?
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46479][CORE] Change `Utils.isJavaVersionAtLeast21` to use the utility method from `commons-lang3` [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on code in PR #44444:
URL: https://github.com/apache/spark/pull/44444#discussion_r1434609660
##########
project/SparkBuild.scala:
##########
@@ -1373,6 +1373,7 @@ object Unidoc {
classpaths
.map(_.filterNot(_.data.getCanonicalPath.matches(""".*kafka-clients-0\.10.*""")))
.map(_.filterNot(_.data.getCanonicalPath.matches(""".*kafka_2\..*-0\.10.*""")))
+ .map(_.filterNot(_.data.getCanonicalPath.contains("apache-rat")))
Review Comment:
@HyukjinKwon Thank you for your suggestion. I first thought of this approach, but the question is which version of the dependency should be pinned? Apache commons-lang3? This seems somewhat futile. The current situation is that there is an old version of commons-lang3 code in `lib/apache-rat-0.14.jar` that has been shaded but not relocated. I haven't figured out how to exclude this code from the classpath using `DependencyOverrides`. Additionally, this may only affects the build of scala unidoc, and it seems that the difference only exists in the `unidocAllClasspaths` memory when building scala unidoc.
##########
project/SparkBuild.scala:
##########
@@ -1373,6 +1373,7 @@ object Unidoc {
classpaths
.map(_.filterNot(_.data.getCanonicalPath.matches(""".*kafka-clients-0\.10.*""")))
.map(_.filterNot(_.data.getCanonicalPath.matches(""".*kafka_2\..*-0\.10.*""")))
+ .map(_.filterNot(_.data.getCanonicalPath.contains("apache-rat")))
Review Comment:
@HyukjinKwon Thank you for your suggestion. I first thought of this approach, but the question is which version of the dependency should be pinned? Apache commons-lang3? This seems somewhat futile. The current situation is that there is an old version of commons-lang3 code in `lib/apache-rat-0.14.jar` that has been shaded but not relocated. I haven't figured out how to exclude this code from the classpath using `DependencyOverrides`. Additionally, this may only affects the build of scala unidoc, and it seems that the difference only exists in the `unidocAllClasspaths` when building scala unidoc.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46479][CORE] Change `Utils.isJavaVersionAtLeast21` to use the utility method from `commons-lang3` [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on code in PR #44444:
URL: https://github.com/apache/spark/pull/44444#discussion_r1434609660
##########
project/SparkBuild.scala:
##########
@@ -1373,6 +1373,7 @@ object Unidoc {
classpaths
.map(_.filterNot(_.data.getCanonicalPath.matches(""".*kafka-clients-0\.10.*""")))
.map(_.filterNot(_.data.getCanonicalPath.matches(""".*kafka_2\..*-0\.10.*""")))
+ .map(_.filterNot(_.data.getCanonicalPath.contains("apache-rat")))
Review Comment:
@HyukjinKwon Thank you for your suggestion. I first thought of this approach, but the question is which version of the dependency should be pinned? Apache commons-lang3? This seems somewhat futile. The current situation is that there is an old version of commons-lang3 code in `lib/apache-rat-0.14.jar` that has been shaded but not relocated. I haven't figured out how to exclude this code from the classpath using `DependencyOverrides`. Additionally, this only affects the build of scala unidoc, and it seems that the difference only exists in the `unidocAllClasspaths` memory when building scala unidoc.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46479][CORE] Change `Utils.isJavaVersionAtLeast21` to use the utility method from `commons-lang3` [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on PR #44444:
URL: https://github.com/apache/spark/pull/44444#issuecomment-1866104373
cc @dongjoon-hyun
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46479][CORE] Change `Utils.isJavaVersionAtLeast21` to use the utility method from `commons-lang3` [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on PR #44444:
URL: https://github.com/apache/spark/pull/44444#issuecomment-1868214887
rebased
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46479][CORE] Change `Utils.isJavaVersionAtLeast21` to use the utility method from `commons-lang3` [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on code in PR #44444:
URL: https://github.com/apache/spark/pull/44444#discussion_r1434325309
##########
project/SparkBuild.scala:
##########
@@ -1373,6 +1373,7 @@ object Unidoc {
classpaths
.map(_.filterNot(_.data.getCanonicalPath.matches(""".*kafka-clients-0\.10.*""")))
.map(_.filterNot(_.data.getCanonicalPath.matches(""".*kafka_2\..*-0\.10.*""")))
+ .map(_.filterNot(_.data.getCanonicalPath.contains("apache-rat")))
Review Comment:
It seems that the `apache-rat-0.14.jar` downloaded during `check-license` is interfering with the generation of unidoc, because there is an old version of the `JavaVersion` class in `apache-rat-0.14.jar` that has not been relocated... Let me try if this change can make the unidoc build successful first. If it can, I will submit a separate PR to complete this ignore work first.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46479][CORE] Change `Utils.isJavaVersionAtLeast21` to use the utility method from `commons-lang3` [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang closed pull request #44444: [SPARK-46479][CORE] Change `Utils.isJavaVersionAtLeast21` to use the utility method from `commons-lang3`
URL: https://github.com/apache/spark/pull/44444
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46479][CORE] Change `Utils.isJavaVersionAtLeast21` to use the utility method from `commons-lang3` [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on PR #44444:
URL: https://github.com/apache/spark/pull/44444#issuecomment-1868259956
Merged into master. Thanks @MaxGekk @yaooqinn @HyukjinKwon
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46479][CORE] Change `Utils.isJavaVersionAtLeast21` to use the utility method from `commons-lang3` [spark]
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #44444:
URL: https://github.com/apache/spark/pull/44444#discussion_r1434601518
##########
project/SparkBuild.scala:
##########
@@ -1373,6 +1373,7 @@ object Unidoc {
classpaths
.map(_.filterNot(_.data.getCanonicalPath.matches(""".*kafka-clients-0\.10.*""")))
.map(_.filterNot(_.data.getCanonicalPath.matches(""".*kafka_2\..*-0\.10.*""")))
+ .map(_.filterNot(_.data.getCanonicalPath.contains("apache-rat")))
Review Comment:
Can we explicitly pin the version via `DependencyOverrides` if the version conflicts?
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46479][CORE] Change `Utils.isJavaVersionAtLeast21` to use the utility method from `commons-lang3` [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on PR #44444:
URL: https://github.com/apache/spark/pull/44444#issuecomment-1866281930
```
[error] /__w/spark/spark/core/src/main/scala/org/apache/spark/util/Utils.scala:1777:77: value JAVA_21 is not a member of object org.apache.commons.lang3.JavaVersion
[error] did you mean JAVA_11? or perhaps JAVA_10, JAVA_12, or JAVA_13? or...?
[error] val isJavaVersionAtLeast21 = SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_21)
[error] ^
[error] /__w/spark/spark/Loading source file /__w/spark/spark/common/sketch/src/main/java/org/apache/spark/util/sketch/BitArray.java...
```
build documentation failed, let me take a look
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-46479][CORE] Change `Utils.isJavaVersionAtLeast21` to use the utility method from `commons-lang3` [spark]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on code in PR #44444:
URL: https://github.com/apache/spark/pull/44444#discussion_r1434732876
##########
project/SparkBuild.scala:
##########
@@ -1373,6 +1373,7 @@ object Unidoc {
classpaths
.map(_.filterNot(_.data.getCanonicalPath.matches(""".*kafka-clients-0\.10.*""")))
.map(_.filterNot(_.data.getCanonicalPath.matches(""".*kafka_2\..*-0\.10.*""")))
+ .map(_.filterNot(_.data.getCanonicalPath.contains("apache-rat")))
Review Comment:
I have submitted a separate pr to address this issue: https://github.com/apache/spark/pull/44453. If the modifications to `SparkBuild.scala` can be done together in the current PR, please let me know.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org