uros-db commented on code in PR #47771:
URL: https://github.com/apache/spark/pull/47771#discussion_r1718416102
##########
common/unsafe/src/test/java/org/apache/spark/unsafe/types/CollationSupportSuite.java:
##########
@@ -887,6 +887,21 @@ private void assertInitCap(String target, String
collationName, String expected)
assertEquals(expected_utf8, CollationSupport.InitCap.exec(target_utf8,
collationId, false));
// Note: results should be the same in these tests for both ICU and
JVM-based implementations.
}
+ private void assertInitCap(String target, String collationName, String
expectedICU,
+ String expectedNonICU)
Review Comment:
code style guide
##########
common/unsafe/src/test/java/org/apache/spark/unsafe/types/CollationSupportSuite.java:
##########
@@ -887,6 +887,21 @@ private void assertInitCap(String target, String
collationName, String expected)
assertEquals(expected_utf8, CollationSupport.InitCap.exec(target_utf8,
collationId, false));
// Note: results should be the same in these tests for both ICU and
JVM-based implementations.
}
+ private void assertInitCap(String target, String collationName, String
expectedICU,
+ String expectedNonICU)
+ throws SparkException {
Review Comment:
code style guide
##########
common/unsafe/src/test/java/org/apache/spark/unsafe/types/CollationSupportSuite.java:
##########
@@ -887,6 +887,21 @@ private void assertInitCap(String target, String
collationName, String expected)
assertEquals(expected_utf8, CollationSupport.InitCap.exec(target_utf8,
collationId, false));
// Note: results should be the same in these tests for both ICU and
JVM-based implementations.
}
+ private void assertInitCap(String target, String collationName, String
expectedICU,
+ String expectedNonICU)
+ throws SparkException {
+ UTF8String target_utf8 = UTF8String.fromString(target);
+ UTF8String expectedICU_utf8 = UTF8String.fromString(expectedICU);
+ UTF8String expectedNonICU_utf8 = UTF8String.fromString(expectedNonICU);
+ int collationId = CollationFactory.collationNameToId(collationName);
+ // Testing the new ICU-based implementation of the Lower function.
+ assertEquals(expectedICU_utf8,
+ CollationSupport.InitCap.exec(target_utf8, collationId, true));
+ // Testing the old JVM-based implementation of the Lower function.
+ assertEquals(expectedNonICU_utf8,
+ CollationSupport.InitCap.exec(target_utf8, collationId, false));
Review Comment:
code style guide
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]