trushev opened a new pull request, #7215:
URL: https://github.com/apache/hudi/pull/7215

   …HoodieTestDataGenerator
   
   ### Change Logs
   
   String.format is locale specific
   Example:
   ```java
   if (Locale.getDefault() == ENGLISH) {
     assert String.format("%5f", 0.1f) == "0.100000"
   }
   if (Locale.getDefault() == GERMAN) {
     assert String.format("%5f", 0.1f) == "0,100000"
   }
   ```
   
   So default GERMAN locale leads to failure of `new BigDecimal("0,100000")` 
with exception `NumberFormatException`.
   It is not convenient to develop when we have locale specific tests.
   
   ### Impact
   
   Fix `NumberFormatException` when default locale consists of comma as decimal 
separator
   ```
   java.lang.NumberFormatException
        at java.math.BigDecimal.<init>(BigDecimal.java:501)
        at java.math.BigDecimal.<init>(BigDecimal.java:387)
        at java.math.BigDecimal.<init>(BigDecimal.java:813)
        at 
org.apache.hudi.common.testutils.HoodieTestDataGenerator.generateGenericRecord(HoodieTestDataGenerator.java:330)
        at 
org.apache.hudi.functional.TestBootstrap.lambda$generateTestRawTripDataset$14(TestBootstrap.java:576)
        at 
java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:110)
        at java.util.stream.IntPipeline$Head.forEach(IntPipeline.java:581)
        at 
org.apache.hudi.functional.TestBootstrap.generateTestRawTripDataset(TestBootstrap.java:574)
        at 
org.apache.hudi.functional.TestBootstrap.generateNewDataSetAndReturnSchema(TestBootstrap.java:165)
        at 
org.apache.hudi.functional.TestBootstrap.testBootstrapCommon(TestBootstrap.java:242)
        at 
org.apache.hudi.functional.TestBootstrap.testMetadataBootstrapNonpartitionedCOW(TestBootstrap.java:182)
   ```
   
   ### Risk level
   
   None
   
   ### Documentation Update
   
   None
   
   ### Contributor's checklist
   
   - [ ] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [ ] Change Logs and Impact were stated clearly
   - [ ] Adequate tests were added if applicable
   - [ ] CI passed
   


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