gpt4 book ai didi

apache-nifi - Apache NiFi DBCPConnectionPool ORA-00933 : SQL command not properly ended for 'select 1 from dual;'

转载 作者:行者123 更新时间:2023-12-04 08:30:39 25 4
gpt4 key购买 nike

我正在 NiFi 上使用 ExecuteSQL 对 Oracle 12c 运行一个简单的查询:

SELECT 1 FROM DUAL;https://pasteboard.co/JCkMVmR.png


使用配置 - DBCPConnectionPool 1.11.4:
https://pasteboard.co/JCkiOnr.png
并收到以下错误:
https://pasteboard.co/JCjGreC.png
org.apache.nifi.processor.exception.ProcessException: java.sql.SQLException: Cannot create PoolableConnectionFactory (ORA-00933: SQL command not properly ended
)
at org.apache.nifi.dbcp.DBCPConnectionPool.getConnection(DBCPConnectionPool.java:444)
at org.apache.nifi.dbcp.DBCPService.getConnection(DBCPService.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:87)
at com.sun.proxy.$Proxy138.getConnection(Unknown Source)
at org.apache.nifi.processors.standard.AbstractExecuteSQL.onTrigger(AbstractExecuteSQL.java:236)
at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1176)
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(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: Cannot create PoolableConnectionFactory (ORA-00933: SQL command not properly ended
)
at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:669)
at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:544)
at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:753)
at org.apache.nifi.dbcp.DBCPConnectionPool.getConnection(DBCPConnectionPool.java:440)
... 20 common frames omitted
Caused by: java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended

at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:494)
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:446)
NiFi nifi-1.11.4-RC1
甲骨文 12.2.0.1.0
ojdbc8.jar (12.2.0.1)
DBCP 连接池 1.11.4
对此有何建议?提前致谢!
编辑
正如评论中所建议的,尝试了版本 没有 分号 ;并得到不同的错误: org.apache.nifi.processor.exception.ProcessException: org.apach e.avro.SchemaParseException: Illegal initial character: 1

最佳答案

要使用 dual ,您需要为返回值设置一个名称,以便结果可以映射到有效的 avro 模式。例如

select 1 as test from dual
返回 test: 1而不仅仅是 1 .

关于apache-nifi - Apache NiFi DBCPConnectionPool ORA-00933 : SQL command not properly ended for 'select 1 from dual;' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65039941/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com