[ 
https://issues.apache.org/jira/browse/NIFI-16336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18115138#comment-18115138
 ] 

Philipp Korniets commented on NIFI-16336:
-----------------------------------------

Additionally, a simple header only file with "Use Starting Row" (no data) 
generates an error.
I dont think this is a correct behaviour. CSV readers dont generate error in 
this scenario. I understand that Excel reader tries to produce schema from the 
data - but if there is no data - perhaps it shoudnt generate error:


{code:java}
 

2026-09-14 12:04:39,406 ERROR [Timer-Driven Process Thread-9] 
o.a.n.processors.standard.ConvertRecord 
ConvertRecord[id=9f624385-01a0-1000-d38d-06c4e2ba8f70] Failed to process 
StandardFlowFileRecord[uuid=a0d48aad-29ee-4214-87fc-0d36ee0ccae6,claim=StandardContentClaim
 [resourceClaim=StandardResourceClaim[id=1789037051820-66, container=default, 
section=66], offset=1120919, length=3956],offset=0,name=LMR Master Fund Limited 
- Valuation Report - 20260911-4.xlsx,size=3956]; will route to failure 
org.apache.nifi.processor.exception.ProcessException: IOException thrown from 
ConvertRecord[id=9f624385-01a0-1000-d38d-06c4e2ba8f70]: java.io.IOException: 
org.apache.nifi.schema.access.SchemaNotFoundException: Failed to infer schema 
from empty rows at 
org.apache.nifi.controller.repository.StandardProcessSession.write(StandardProcessSession.java:3632)
 at 
org.apache.nifi.controller.repository.WeakHashMapProcessSessionFactory$FactoryRetainingProcessSession.write(WeakHashMapProcessSessionFactory.java:285)
 at 
org.apache.nifi.processors.standard.AbstractRecordProcessor.onTrigger(AbstractRecordProcessor.java:125)
 at 
org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
 at 
org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1293)
 at 
org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:237)
 at 
org.apache.nifi.controller.scheduling.AbstractTimeBasedSchedulingAgent.lambda$doScheduleOnce$0(AbstractTimeBasedSchedulingAgent.java:59)
 at org.apache.nifi.engine.FlowEngine.lambda$wrap$1(FlowEngine.java:105) at 
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at 
java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
 at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
 at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
 at java.base/java.lang.Thread.run(Thread.java:1583) {code}
{code:java}
Caused by: java.io.IOException: 
org.apache.nifi.schema.access.SchemaNotFoundException: Failed to infer schema 
from empty rows at 
org.apache.nifi.excel.ExcelStartingRowSchemaInference.createSchema(ExcelStartingRowSchemaInference.java:148)
 at 
org.apache.nifi.excel.ExcelStartingRowSchemaInference.inferSchema(ExcelStartingRowSchemaInference.java:87)
 at 
org.apache.nifi.schema.inference.InferSchemaAccessStrategy.getSchema(InferSchemaAccessStrategy.java:49)
 at 
org.apache.nifi.serialization.SchemaRegistryService.getSchema(SchemaRegistryService.java:163)
 at org.apache.nifi.excel.ExcelReader.createRecordReader(ExcelReader.java:139) 
at 
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
 at java.base/java.lang.reflect.Method.invoke(Method.java:580) at 
org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:273)
 at 
org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:127)
 at jdk.proxy78/jdk.proxy78.$Proxy182.createRecordReader(Unknown Source) at 
org.apache.nifi.processors.standard.AbstractRecordProcessor.lambda$onTrigger$0(AbstractRecordProcessor.java:127)
 at 
org.apache.nifi.controller.repository.StandardProcessSession.write(StandardProcessSession.java:3611)
 ... 13 common frames omitted Caused by: 
org.apache.nifi.schema.access.SchemaNotFoundException: Failed to infer schema 
from empty rows ... 25 common frames omitted
 
{code}
 

> ExcelReader - empty files with footer
> -------------------------------------
>
>                 Key: NIFI-16336
>                 URL: https://issues.apache.org/jira/browse/NIFI-16336
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: nifi-api-2.11.0
>            Reporter: Philipp Korniets
>            Priority: Major
>         Attachments: TestBook_20261109.xlsx, 
> image-2026-09-11-14-31-21-487.png, image-2026-09-11-14-34-34-432.png
>
>
> ConvertRecord  with ExcelReader and CSVRecordWriter with below setup:
> sheetName=Valuation
> startingRow = 5
> Test book: [^TestBook_20261109.xlsx]
> Expect - either no flowfile to be generated or flowfile with full header row 
> and some value in the 3rd row in ID field.
> However it skips all the headers except ID - because this is the only field 
> which has value within 10 rows. (Row Evaluation Strategy)
> !image-2026-09-11-14-31-21-487.png|width=476,height=383!
>  
> !image-2026-09-11-14-34-34-432.png|width=467,height=167!
>  
> This behaviour breaks downstream processes like queryRecord which relies on 
> presence of certain fields.
> There is a workaround to check the schema etc... but its different from the 
> behaviour we had in ConvertExcelToCSV  processor.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to