NiFi - QueryDatabaseTableRecord 处理器中的语法错误

时间:2021-04-08 14:07:20

标签: mysql apache-nifi

我在运行 QueryDatabaseTableRecord- 处理器时收到以下错误:

<块引用>

由于您的 sql 语法错误,无法执行 sql select query SELECT * FROM example_database;检查手册 对应于您的 MySQL 服务器版本以使用正确的语法 靠近第 1 行的 example_database

我的处理器配置如下:

processor

我知道 MySQL 连接器配置正确,因为我可以连接到数据库本身。主要问题似乎是表名。我担心这是因为我的名字包含下划线(考虑到一般的 MySQL 命名约定,这应该没问题)。我试过用“.”代替下划线,使用不同的引号但没有任何作用。我 100% 确定表名本身(由图片中的示例替换)是正确的。

有人可以帮忙吗?

编辑:我已经为下面的 MySQL 连接器添加了配置。 Pool config

编辑:我现在也使用了调试模式并收到以下错误消息:

2021-04-15 12:36:45,758 ERROR [Timer-Driven Process Thread-3] o.a.nifi.processors.standard.ExecuteSQL ExecuteSQL[id=b37c3f9a-6d28-1cf1-8271-58bb0a04c935] Unable to execute SQL select query SELECT * FROM example_table due to java.sql.SQLSyntaxErrorException: Table 'database.example_table' doesn't exist. No FlowFile to route to failure: java.sql.SQLSyntaxErrorException: Table 'database.example_table' doesn't exist
java.sql.SQLSyntaxErrorException: Table 'database.example_table' doesn't exist
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
    at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:370)
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:94)
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:94)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:254)
    at org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler.access$100(StandardControllerServiceInvocationHandler.java:38)
    at org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler$ProxiedReturnObjectInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:240)
    at com.sun.proxy.$Proxy155.execute(Unknown Source)
    at org.apache.nifi.processors.standard.AbstractExecuteSQL.onTrigger(AbstractExecuteSQL.java:267)
    at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
    at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1174)
    at org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:213)
    at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)
    at org.apache.nifi.engine.FlowEngine$2.run(FlowEngine.java:110)
    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:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
2021-04-15 12:36:45,766 INFO [Timer-Driven Process Thread-3] o.a.n.p.store.WriteAheadStorePartition Successfully rolled over Event Writer for Provenance Event Store Partition[directory=./provenance_repository] due to MAX_TIME_REACHED
2021-04-15 12:36:46,449 INFO [NiFi Web Server-432] o.a.n.c.s.StandardProcessScheduler Stopping ExecuteSQL[id=b37c3f9a-6d28-1cf1-8271-58bb0a04c935]
2021-04-15 12:36:46,449 INFO [NiFi Web Server-432] o.a.n.controller.StandardProcessorNode Stopping processor: ExecuteSQL[id=b37c3f9a-6d28-1cf1-8271-58bb0a04c935]
2021-04-15 12:36:46,449 INFO [Timer-Driven Process Thread-10] o.a.n.c.s.TimerDrivenSchedulingAgent Stopped scheduling ExecuteSQL[id=b37c3f9a-6d28-1cf1-8271-58bb0a04c935] to run
2021-04-15 12:36:46,771 INFO [Flow Service Tasks Thread-1] o.a.nifi.controller.StandardFlowService Saved flow controller org.apache.nifi.controller.FlowController@4127e0c // Another save pending = false
2021-04-15 12:36:49,386 INFO [pool-12-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Initiating checkpoint of FlowFile Repository
2021-04-15 12:36:49,386 INFO [pool-12-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Successfully checkpointed FlowFile Repository with 0 records in 0 milliseconds

0 个答案:

没有答案