Skip to content

[SPARK-36681][CORE][TESTS][FOLLOW-UP] Tests only when Snappy native library is available in low Hadoop versions#36136

Closed
HyukjinKwon wants to merge 1 commit intoapache:masterfrom
HyukjinKwon:SPARK-36681
Closed

[SPARK-36681][CORE][TESTS][FOLLOW-UP] Tests only when Snappy native library is available in low Hadoop versions#36136
HyukjinKwon wants to merge 1 commit intoapache:masterfrom
HyukjinKwon:SPARK-36681

Conversation

@HyukjinKwon
Copy link
Copy Markdown
Member

@HyukjinKwon HyukjinKwon commented Apr 11, 2022

What changes were proposed in this pull request?

This PR is a minor followup to only test when Snappy native library is available in low Hadoop versions.
From Hadoop 3.3.1 with HADOOP-17125, the tests should pass but it fails in lower versions of Hadoop when Snappy native library is unavailable (see also #35784 (comment)).

Why are the changes needed?

To make the tests robust.

Does this PR introduce any user-facing change?

Nope, this is test-only.

How was this patch tested?

Should monitor CI

@HyukjinKwon
Copy link
Copy Markdown
Member Author

cc @viirya FYI

@github-actions github-actions bot added the CORE label Apr 11, 2022
Copy link
Copy Markdown
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM.

@HyukjinKwon
Copy link
Copy Markdown
Member Author

Thanks guys.

Merged to master and branch-3.3.

HyukjinKwon added a commit that referenced this pull request Apr 11, 2022
…ibrary is available in low Hadoop versions

### What changes were proposed in this pull request?

This PR is a minor followup to only test when Snappy native library is available in low Hadoop versions.
From Hadoop 3.3.1 with `HADOOP-17125`, the tests should pass but it fails in lower versions of Hadoop when Snappy native library is unavailable (see also #35784 (comment)).

### Why are the changes needed?

To make the tests robust.

### Does this PR introduce _any_ user-facing change?

Nope, this is test-only.

### How was this patch tested?

Should monitor CI

Closes #36136 from HyukjinKwon/SPARK-36681.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
(cherry picked from commit bf19a5e)
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
dongjoon-hyun pushed a commit that referenced this pull request May 26, 2022
… native library is not available in low Hadoop versions

### What changes were proposed in this pull request?

This is a follow-up to #36136 to fix `LinkageError` handling in `FileSuite` to avoid test suite abort when Snappy native library is not available in low Hadoop versions:
```
23:16:22 FileSuite:
23:16:22 org.apache.spark.FileSuite *** ABORTED ***
23:16:22   java.lang.RuntimeException: Unable to load a Suite class that was discovered in the runpath: org.apache.spark.FileSuite
23:16:22   at org.scalatest.tools.DiscoverySuite$.getSuiteInstance(DiscoverySuite.scala:81)
23:16:22   at org.scalatest.tools.DiscoverySuite.$anonfun$nestedSuites$1(DiscoverySuite.scala:38)
23:16:22   at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:238)
23:16:22   at scala.collection.Iterator.foreach(Iterator.scala:941)
23:16:22   at scala.collection.Iterator.foreach$(Iterator.scala:941)
23:16:22   at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
23:16:22   at scala.collection.IterableLike.foreach(IterableLike.scala:74)
23:16:22   at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
23:16:22   at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
23:16:22   at scala.collection.TraversableLike.map(TraversableLike.scala:238)
23:16:22   ...
23:16:22   Cause: java.lang.UnsatisfiedLinkError: org.apache.hadoop.util.NativeCodeLoader.buildSupportsSnappy()Z
23:16:22   at org.apache.hadoop.util.NativeCodeLoader.buildSupportsSnappy(Native Method)
23:16:22   at org.apache.hadoop.io.compress.SnappyCodec.checkNativeCodeLoaded(SnappyCodec.java:63)
23:16:22   at org.apache.hadoop.io.compress.SnappyCodec.getCompressorType(SnappyCodec.java:136)
23:16:22   at org.apache.spark.FileSuite.$anonfun$new$12(FileSuite.scala:145)
23:16:22   at scala.util.Try$.apply(Try.scala:213)
23:16:22   at org.apache.spark.FileSuite.<init>(FileSuite.scala:141)
23:16:22   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
23:16:22   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
23:16:22   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
23:16:22   at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
```
Scala's `Try` can handle only `NonFatal` throwables.

### Why are the changes needed?
To make the tests robust.

### Does this PR introduce _any_ user-facing change?
Nope, this is test-only.

### How was this patch tested?
Manual test.

Closes #36687 from peter-toth/SPARK-36681-handle-linkageerror.

Authored-by: Peter Toth <ptoth@cloudera.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit dbde778)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
dongjoon-hyun pushed a commit that referenced this pull request May 26, 2022
… native library is not available in low Hadoop versions

### What changes were proposed in this pull request?

This is a follow-up to #36136 to fix `LinkageError` handling in `FileSuite` to avoid test suite abort when Snappy native library is not available in low Hadoop versions:
```
23:16:22 FileSuite:
23:16:22 org.apache.spark.FileSuite *** ABORTED ***
23:16:22   java.lang.RuntimeException: Unable to load a Suite class that was discovered in the runpath: org.apache.spark.FileSuite
23:16:22   at org.scalatest.tools.DiscoverySuite$.getSuiteInstance(DiscoverySuite.scala:81)
23:16:22   at org.scalatest.tools.DiscoverySuite.$anonfun$nestedSuites$1(DiscoverySuite.scala:38)
23:16:22   at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:238)
23:16:22   at scala.collection.Iterator.foreach(Iterator.scala:941)
23:16:22   at scala.collection.Iterator.foreach$(Iterator.scala:941)
23:16:22   at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
23:16:22   at scala.collection.IterableLike.foreach(IterableLike.scala:74)
23:16:22   at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
23:16:22   at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
23:16:22   at scala.collection.TraversableLike.map(TraversableLike.scala:238)
23:16:22   ...
23:16:22   Cause: java.lang.UnsatisfiedLinkError: org.apache.hadoop.util.NativeCodeLoader.buildSupportsSnappy()Z
23:16:22   at org.apache.hadoop.util.NativeCodeLoader.buildSupportsSnappy(Native Method)
23:16:22   at org.apache.hadoop.io.compress.SnappyCodec.checkNativeCodeLoaded(SnappyCodec.java:63)
23:16:22   at org.apache.hadoop.io.compress.SnappyCodec.getCompressorType(SnappyCodec.java:136)
23:16:22   at org.apache.spark.FileSuite.$anonfun$new$12(FileSuite.scala:145)
23:16:22   at scala.util.Try$.apply(Try.scala:213)
23:16:22   at org.apache.spark.FileSuite.<init>(FileSuite.scala:141)
23:16:22   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
23:16:22   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
23:16:22   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
23:16:22   at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
```
Scala's `Try` can handle only `NonFatal` throwables.

### Why are the changes needed?
To make the tests robust.

### Does this PR introduce _any_ user-facing change?
Nope, this is test-only.

### How was this patch tested?
Manual test.

Closes #36687 from peter-toth/SPARK-36681-handle-linkageerror.

Authored-by: Peter Toth <ptoth@cloudera.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
@HyukjinKwon HyukjinKwon deleted the SPARK-36681 branch January 15, 2024 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants