Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/17472#discussion_r108775406
--- Diff: common/unsafe/src/main/java/org/apache/spark/unsafe/Platform.java
---
@@ -46,16 +46,22 @@
private static final boolean unaligned;
static {
boolean _unaligned;
+ String arch = System.getProperty("os.arch", "");
// use reflection to access unaligned field
try {
Class<?> bitsClass =
Class.forName("java.nio.Bits", false,
ClassLoader.getSystemClassLoader());
Method unalignedMethod = bitsClass.getDeclaredMethod("unaligned");
unalignedMethod.setAccessible(true);
- _unaligned = Boolean.TRUE.equals(unalignedMethod.invoke(null));
+
+ //Since java.nio.Bits.unaligned() doesn't return true on ppc (See
JDK-8165231)
+ if(arch.matches("^(ppc64le|ppc64)$")){
--- End diff --
I think you can perform this check up top? you don't need to do all the
reflection here if the arch matches. Also is it true that anything starting
with "ppc64" should be special-cased?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]