wombatu-kun commented on code in PR #19835:
URL: https://github.com/apache/hudi/pull/19835#discussion_r3939051380


##########
hudi-common/src/test/java/org/apache/hudi/common/schema/TestHoodieSchemaUtils.java:
##########
@@ -1044,15 +1045,41 @@ public void testGenerateProjectionSchema() {
     assertTrue(fieldNames1.contains("timestamp"));
 
     // Field names are matched case-insensitively; HiveHoodieReaderContext 
lowercases names before calling this.
-    HoodieSchema schema2 = 
HoodieSchemaUtils.generateProjectionSchema(originalSchema, 
Arrays.asList("_ROW_KEY"));
+    HoodieSchema schema2 = 
HoodieSchemaUtils.generateProjectionSchema(originalSchema, 
Arrays.asList("PII_COL"));
     assertEquals(1, schema2.getFields().size());
-    assertEquals("_row_key", schema2.getFields().get(0).name());
+    assertEquals("pii_col", schema2.getFields().get(0).name());
 
     Throwable caughtException = assertThrows(HoodieException.class, () ->
         HoodieSchemaUtils.generateProjectionSchema(originalSchema, 
Arrays.asList("_row_key", "timestamp", "fake_field")));
     assertTrue(caughtException.getMessage().contains("Field fake_field not 
found in log schema. Query cannot proceed!"));
   }
 
+  @Test
+  public void testGenerateProjectionSchemaIgnoresDefaultLocale() {
+    // Under tr-TR, String#toLowerCase() maps an upper-case I to dotless-i 
(U+0131), so a default-locale lowercase
+    // on one side of the lookup and Locale.ROOT on the other 
(HiveHoodieReaderContext) cannot match for any name
+    // that contains an upper-case I. Surefire runs this module single-forked 
and sequentially, so toggling the

Review Comment:
   Single-fork reuse is the condition that would let an unrestored 
default-locale toggle reach later tests in the same JVM, not the thing that 
prevents it - the `finally` restore is what makes this safe. Worth pointing the 
comment at the restore instead, since no pom pins `forkCount` or `reuseForks` 
for hudi-common in the first place.



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

Reply via email to