Hi all

I have a issue with using the QueryRecord query csv files. currently i'm
running NiFi version 1.12.1 but I also tested this in version 1.13.0
If my incoming csv file only have a header line and no data it fails

My querying statement looks like this: SELECT colA FROM FLOWFILE WHERE colC
= 'true'

Changes made to the CSVReader:
Treat Firs Line as Header = true

Changes made to the CSVRecordSetWriter:
Include Header Line = false
Record Separator = ,

Here are 2 sample data. The first one works as expected, but sample 2 gives
errors
Sample 1:
colA,colB,colC
data1A,data1B,true
data2A,data2B,false
data3A,data3B,true

Outcome: data1A,data3A,

Sample 2:
colA,colB,colC

Error message:
QueryRecord[id=d7c38f75-0177-1000-ffff-fffff694dd96] Unable to query
StandardFlowFileRecord[uuid=74a71c6e-3d3f-406c-92af-c9e4e27d6d69,claim=StandardContentClaim
[resourceClaim=StandardResourceClaim[id=1614232293848-3,
container=Node01Cont01, section=3], offset=463,
length=14],offset=0,name=74a71c6e-3d3f-406c-92af-c9e4e27d6d69,size=14] due
to java.sql.SQLException: Error while preparing statement [SELECT colA FROM
FLOWFILE WHERE colC = true]:
org.apache.nifi.processor.exception.ProcessException:
java.sql.SQLException: Error while preparing statement [SELECT colA FROM
FLOWFILE WHERE colC = true]

Is this a bug?

kind regards
Jens M. Kofoed

Reply via email to