dan-s1 commented on code in PR #9290:
URL: https://github.com/apache/nifi/pull/9290#discussion_r1779160056
##########
nifi-extension-bundles/nifi-poi-bundle/nifi-poi-services/src/main/java/org/apache/nifi/excel/ExcelRecordReader.java:
##########
@@ -127,17 +134,6 @@ private Map<String, Object> getCurrentRowValues(Row
currentRow, boolean coerceTy
return currentRowValues;
}
- private static Object getCellValue(Cell cell) {
- if (cell != null) {
- return switch (cell.getCellType()) {
- case _NONE, BLANK, ERROR, FORMULA, STRING ->
cell.getStringCellValue();
- case NUMERIC -> DateUtil.isCellDateFormatted(cell) ?
cell.getDateCellValue() : cell.getNumericCellValue();
- case BOOLEAN -> cell.getBooleanCellValue();
Review Comment:
@exceptionfactory I see the build is failing on the Windows box which has
the French Locale and in France the separator is a comma and not a period for a
float number. The stacktrace I see is
```
Caused by: java.lang.NumberFormatException: For input string: "18,36"
at
java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
at
java.base/jdk.internal.math.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
at java.base/java.lang.Float.parseFloat(Float.java:556)
at
org.apache.nifi.serialization.record.util.DataTypeUtils.toFloat(DataTypeUtils.java:1330)
at
org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:209)
at
org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:174)
at
org.apache.nifi.excel.ExcelRecordReader.convert(ExcelRecordReader.java:134)
at
org.apache.nifi.excel.ExcelRecordReader.lambda$getCurrentRowValues$0(ExcelRecordReader.java:119)
at
java.base/java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:104)
at
java.base/java.util.stream.IntPipeline$Head.forEach(IntPipeline.java:617)
at
org.apache.nifi.excel.ExcelRecordReader.getCurrentRowValues(ExcelRecordReader.java:106)
```
Can this be a bug in `DataTypeUtils` which does not take into account the
`Locale` when parsing a string to a number?
--
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]