Skip to content

Commit

Permalink
[MINOR] Fix locale specific NumberFormatException in testutils Hoodie…
Browse files Browse the repository at this point in the history
…TestDataGenerator (#7215)
  • Loading branch information
trushev authored Dec 7, 2022
1 parent 20eea46 commit 6629bf7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Random;
import java.util.Set;
Expand Down Expand Up @@ -363,7 +364,7 @@ private void generateExtraSchemaValues(GenericRecord rec) {
rec.put("current_date", (int) LocalDateTime.ofInstant(instant, ZoneOffset.UTC).toLocalDate().toEpochDay());
rec.put("current_ts", randomMillis);

BigDecimal bigDecimal = new BigDecimal(String.format("%5f", rand.nextFloat()));
BigDecimal bigDecimal = new BigDecimal(String.format(Locale.ENGLISH, "%5f", rand.nextFloat()));
Schema decimalSchema = AVRO_SCHEMA.getField("height").schema();
Conversions.DecimalConversion decimalConversions = new Conversions.DecimalConversion();
GenericFixed genericFixed = decimalConversions.toFixed(bigDecimal, decimalSchema, LogicalTypes.decimal(10, 6));
Expand Down

0 comments on commit 6629bf7

Please sign in to comment.