jiangxb1987 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_r408613304
##########
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:
Why do we need to do that? The default value of TEST_UAO_SIZE should be the
same as UAO_SIZE, only if you want to test other values then you need to change
it.
----------------------------------------------------------------
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]