yihua commented on code in PR #19753:
URL: https://github.com/apache/hudi/pull/19753#discussion_r3867256072


##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/TestHoodieSparkSqlWriter.scala:
##########
@@ -1420,6 +1420,57 @@ def testBulkInsertForDropPartitionColumn(): Unit = {
     val tableMetaClient = createMetaClient(spark, tempBasePath)
     new TableSchemaResolver(tableMetaClient).getTableSchema(false)
   }
+
+  /**
+   * Test that upsert works correctly when partition path contains Unicode 
characters.
+   * Reproduces a bug where UTF-8 bytes for characters like "ü" (U+00FC) get 
misinterpreted
+   * as Latin-1 during the String-to-Path round-trip, causing file-not-found 
errors on the
+   * second write.
+   */
+  @Test
+  def testUpsertWithUnicodePartitionPath(): Unit = {
+    val options = Map(
+      DataSourceWriteOptions.TABLE_TYPE.key -> 
HoodieTableType.COPY_ON_WRITE.name(),
+      DataSourceWriteOptions.PRECOMBINE_FIELD.key -> "ts",
+      DataSourceWriteOptions.RECORDKEY_FIELD.key -> "uuid",
+      DataSourceWriteOptions.PARTITIONPATH_FIELD.key -> "company",
+      DataSourceWriteOptions.KEYGENERATOR_CLASS_NAME.key -> 
"org.apache.hudi.keygen.SimpleKeyGenerator",
+      HoodieWriteConfig.TBL_NAME.key -> "hoodie_test",
+      "hoodie.insert.shuffle.parallelism" -> "1",
+      "hoodie.upsert.shuffle.parallelism" -> "1",
+      "hoodie.filesystem.view.remote.response.charset" -> "UTF-8"
+    )
+
+    // Unicode partition value containing German umlaut ü (U+00FC)
+    val unicodePartition = "München"

Review Comment:
   Use `\u00fc` here
   ```suggestion
       val unicodePartition = "M\u00fcnchen"
   ```



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