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

bruce lowther edited comment on NIFI-4238 at 9/7/17 8:53 PM:
-------------------------------------------------------------

Just to remove most of the database types from the equation, I created table:
{code:sql}
create table footest (first text, second text, third text);
insert into footest (first,second,third) values ('one','two','three');
{code}

when I configure the QueryDatabaseTable, I get similar error:
{code:text}
2017-09-07 20:46:26,468 ERROR [Timer-Driven Process Thread-57] 
o.a.n.p.standard.QueryDatabaseTable 
QueryDatabaseTable[id=015e134c-5c1d-1689-deb5-be21b71befec]
Unable to execute SQL select query SELECT first,second,third FROM footest due 
to org.apache.nifi.processor.exception.ProcessException: Error during database 
qu
ery or conversion of records to Avro.: {}
org.apache.nifi.processor.exception.ProcessException: Error during database 
query or conversion of records to Avro.
        at 
org.apache.nifi.processors.standard.QueryDatabaseTable.lambda$onTrigger$13(QueryDatabaseTable.java:305)
        at 
org.apache.nifi.controller.repository.StandardProcessSession.write(StandardProcessSession.java:2529)
        at 
org.apache.nifi.processors.standard.QueryDatabaseTable.onTrigger(QueryDatabaseTable.java:299)
        at 
org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1120)
        at 
org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:147)
        at 
org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:47)
        at 
org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:132)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: SQLite JDBC: inconsistent internal 
state
        at org.sqlite.core.CoreResultSet.checkCol(CoreResultSet.java:81)
        at 
org.sqlite.jdbc3.JDBC3ResultSet.getColumnCount(JDBC3ResultSet.java:699)
        at 
org.apache.nifi.processors.standard.util.JdbcCommon.createSchema(JdbcCommon.java:423)
        at 
org.apache.nifi.processors.standard.util.JdbcCommon.convertToAvroStream(JdbcCommon.java:242)
        at 
org.apache.nifi.processors.standard.QueryDatabaseTable.lambda$onTrigger$13(QueryDatabaseTable.java:303)
        ... 13 common frames omitted
{code}


When I run this from 'ExecuteSQL' I get a flow file with one row.
{code:txt}
[ {
  "first" : "one",
  "second" : "two",
  "third" : "three"
} ]
{code}


was (Author: osunderdog):
Just to remove most of the database types from the equation, I created table:
{code:sql}
create table footest (first text, second text, third text);
insert into footest (first,second,third) values ('one','two','three');
{code}

when I configure the QueryDatabaseTable, I get similar error:
{code:text}
2017-09-07 20:46:26,468 ERROR [Timer-Driven Process Thread-57] 
o.a.n.p.standard.QueryDatabaseTable 
QueryDatabaseTable[id=015e134c-5c1d-1689-deb5-be21b71befec]
Unable to execute SQL select query SELECT first,second,third FROM footest due 
to org.apache.nifi.processor.exception.ProcessException: Error during database 
qu
ery or conversion of records to Avro.: {}
org.apache.nifi.processor.exception.ProcessException: Error during database 
query or conversion of records to Avro.
        at 
org.apache.nifi.processors.standard.QueryDatabaseTable.lambda$onTrigger$13(QueryDatabaseTable.java:305)
        at 
org.apache.nifi.controller.repository.StandardProcessSession.write(StandardProcessSession.java:2529)
        at 
org.apache.nifi.processors.standard.QueryDatabaseTable.onTrigger(QueryDatabaseTable.java:299)
        at 
org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1120)
        at 
org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:147)
        at 
org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:47)
        at 
org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:132)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: SQLite JDBC: inconsistent internal 
state
        at org.sqlite.core.CoreResultSet.checkCol(CoreResultSet.java:81)
        at 
org.sqlite.jdbc3.JDBC3ResultSet.getColumnCount(JDBC3ResultSet.java:699)
        at 
org.apache.nifi.processors.standard.util.JdbcCommon.createSchema(JdbcCommon.java:423)
        at 
org.apache.nifi.processors.standard.util.JdbcCommon.convertToAvroStream(JdbcCommon.java:242)
        at 
org.apache.nifi.processors.standard.QueryDatabaseTable.lambda$onTrigger$13(QueryDatabaseTable.java:303)
        ... 13 common frames omitted
{code}


When I run this from 'ExecuteSQL' I get a flow file with one row.
{code:json}
[ {
  "first" : "one",
  "second" : "two",
  "third" : "three"
} ]
{code}

> Error in QueryDatabaseTable (NiFi CDC support): Unable to execute SQL select 
> query due to org.apache.nifi.processor.exception.ProcessException: Error 
> during database query or conversion of records to Avro
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-4238
>                 URL: https://issues.apache.org/jira/browse/NIFI-4238
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 1.3.0
>         Environment: Centos
>            Reporter: Ella
>         Attachments: config_file_1.png, config_file_2.png, config_file_3.png, 
> diagram.png, Error.png, QueryDatabaseTableError.png
>
>
> Hi Guys,
> I should retrieve only the new added records from the DB2 database to a file 
> by NiFi's CDC feature--QueryDatabaseTable processor; however, I have 
> encountered the Error during executing my dataflow scenario. I have 
> respectfully attached the snapshot of Error as well as the dataflow; I would 
> really appreciate if someone helped me after all.
> Thanks a lot.
> Sincerely,
> Ella



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to