Ngone51 commented on a change in pull request #28195: [SPARK-31425][SQL][CORE]
UnsafeKVExternalSorter/VariableLengthRowBasedKeyValueBatch should also respect
UnsafeAlignedOffset
URL: https://github.com/apache/spark/pull/28195#discussion_r408808993
##########
File path:
common/unsafe/src/main/java/org/apache/spark/unsafe/UnsafeAlignedOffset.java
##########
@@ -28,12 +28,20 @@
private static final int UAO_SIZE = Platform.unaligned() ? 4 : 8;
+ private static int TEST_UAO_SIZE = 0;
+
+ // used for test only
+ public static void setUaoSize(int size) {
+ assert size == 0 || size == 4 || size == 8;
+ TEST_UAO_SIZE = size;
+ }
+
public static int getUaoSize() {
- return UAO_SIZE;
+ return TEST_UAO_SIZE == 0 ? UAO_SIZE : TEST_UAO_SIZE;
Review comment:
hmm...unfortunately, `unsafe` project doesn't depend on `core`. So we can
not access the `Utils`.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]