You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/09/21 14:19:20 UTC

[GitHub] [spark] srowen commented on a change in pull request #29815: [SPARK-32950][SQL] Remove unnecessary big-endian code paths.

srowen commented on a change in pull request #29815:
URL: https://github.com/apache/spark/pull/29815#discussion_r492084853



##########
File path: sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OnHeapColumnVector.java
##########
@@ -392,15 +392,8 @@ public void putFloats(int rowId, int count, float[] src, int srcIndex) {
 
   @Override
   public void putFloats(int rowId, int count, byte[] src, int srcIndex) {
-    if (!bigEndianPlatform) {
-      Platform.copyMemory(src, Platform.BYTE_ARRAY_OFFSET + srcIndex, floatData,
-          Platform.DOUBLE_ARRAY_OFFSET + rowId * 4L, count * 4L);
-    } else {
-      ByteBuffer bb = ByteBuffer.wrap(src).order(ByteOrder.BIG_ENDIAN);
-      for (int i = 0; i < count; ++i) {
-        floatData[i + rowId] = bb.getFloat(srcIndex + (4 * i));
-      }
-    }
+    Platform.copyMemory(src, Platform.BYTE_ARRAY_OFFSET + srcIndex, floatData,
+        Platform.DOUBLE_ARRAY_OFFSET + rowId * 4L, count * 4L);

Review comment:
       It seems Ok to fix here. I presume they are in fact the same, so it has worked to date.




----------------------------------------------------------------
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.

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