[ https://issues.apache.org/jira/browse/NIFI-13988?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17897200#comment-17897200 ]
Daniel Stieglitz edited comment on NIFI-13988 at 11/11/24 6:25 PM: ------------------------------------------------------------------- [~exceptionfactory] I wanted to clarify what you meant with {quote}number handling should account for an empty string and treat it as a {{null}} when the inferred type is a number. {quote} What do you mean by empty? Do you mean * null / string length is 0 or do you mean * null / string is blank i.e. only white space Also when you say number parsing does that mean all number parsing big decimal, big int, double, float, integer, long and short? Lastly should this be the same behavior for all types (other than string and perhaps char) if the string is empty it should be treated as null? was (Author: JIRAUSER294662): [~exceptionfactory] I wanted to clarify what you meant with {quote}number handling should account for an empty string and treat it as a {{null}} when the inferred type is a number. {quote} What do you mean by empty? Do you mean * null or string length is 0 or do you mean * null or string is blank i.e. only white space Also when you say number parsing does that mean all number parsing big decimal, big int, double, float, integer, long and short? Lastly should this be the same behavior for all types (other than string and perhaps char) if the string is empty it should be treated as null? > ExcelReader - Use Starting Row schema strategy and string empty values > ---------------------------------------------------------------------- > > Key: NIFI-13988 > URL: https://issues.apache.org/jira/browse/NIFI-13988 > Project: Apache NiFi > Issue Type: Bug > Components: Core Framework > Affects Versions: 1.28.0, 2.0.0 > Reporter: Philipp Korniets > Assignee: Daniel Stieglitz > Priority: Major > Attachments: Test workbook NiFi2_0.xlsx > > > When Use Starting Row as schema strategy in ExcelReader it analyses first 10 > row. Problem appears with empty cells of *Numerical* type which can appear > anywhere after 10 rows. The cells *looks like* NULL, but actually is an empty > string. > File with example data attached. > Field Exercise Price. > Use Starting Row throws an error: > {code:java} > Caused by: java.lang.NumberFormatException: For input string: "" > at > java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67) > at java.base/java.lang.Long.parseLong(Long.java:719) > at java.base/java.lang.Long.parseLong(Long.java:832) > at > org.apache.nifi.serialization.record.util.DataTypeUtils.toLong(DataTypeUtils.java:1391) > at > org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:213) > at > org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:174) > at > org.apache.nifi.excel.ExcelRecordReader.convert(ExcelRecordReader.java:170) > at > org.apache.nifi.excel.ExcelRecordReader.lambda$getCurrentRowValues$0(ExcelRecordReader.java:127) > 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:114) > at > org.apache.nifi.excel.ExcelRecordReader.nextRecord(ExcelRecordReader.java:84) > ... 28 common frames omitted{code} -- This message was sent by Atlassian Jira (v8.20.10#820010)