由于createSchema,Nifi ExecuteSQL无法处理会话:未知SQL类型1111

时间:2018-05-03 04:11:40

标签: sql postgresql apache-nifi hstore

我正在使用Nifi,我想将数据从postgresql表传输到Json文件。

我在postgresql数据库中有一个带有模式的表:

CREATE TABLE "public"."users" (
 "id" int4 NOT NULL DEFAULT nextval('users_id_seq'::regclass),
 "email" varchar(255) COLLATE "pg_catalog"."default" NOT NULL DEFAULT ''::character varying,
 "settings" "public"."hstore" NOT NULL DEFAULT ''::hstore,
 "credited_at" timestamp(6)
);

CREATE INDEX "index_users_on_settings" ON "public"."users" USING gist (
 "settings" "public"."gist_hstore_ops"
);

ALTER TABLE "public"."users" ADD CONSTRAINT "users_pkey" PRIMARY KEY ("id");

我尝试通过数据流 Nifi 将此user表格中的数据传输到json个文件。

主要Nifi流程: enter image description here 从用户表中获取数据并移至Nifi RGP: enter image description here 获取数据并运行ExecuteSQL: enter image description here 启动ExecuteSQL时出错: enter image description here

我得到了Avro架构的错误

  

ExecuteSQL [id = 1f22e067-0163-1000-ffff-ffff9c047041]由于createSchema,ExecuteSQL [id = 1f22e067-0163-1000-ffff-ffff9c047041]无法处理会话:未知SQL类型1111 / hstore(表:users, column:settings)无法转换为Avro类型;处理器管理性持续1秒:java.lang.IllegalArgumentException:createSchema:未知SQL类型1111 / hstore(表:users,column:settings)无法转换为Avro类型

我试图在谷歌上搜索一个解决方案但是没有办法解决这个问题。 请你帮助我好吗? 谢谢。

这是来自nifi-app.log的堆栈跟踪

  

2018-05-03 04:54:43,418 ERROR [定时器驱动的过程线程-6]   o.a.nifi.processors.standard.ExecuteSQL   的ExecuteSQL [ID = 1f22e067-0163-1000-FFFF-ffff9c047041]   ExecuteSQL [id = 1f22e067-0163-1000-ffff-ffff9c047041]无法处理   由于java.lang.IllegalArgumentException而导致的session:createSchema:   未知的SQL类型1111 / hstore(表:users,column:settings)不能   转换为Avro型;处理器在行政上产生1   sec:java.lang.IllegalArgumentException:createSchema:未知的SQL   类型1111 / hstore(表:用户,列:设置)不能   转换为Avro类型java.lang.IllegalArgumentException:   createSchema:未知的SQL类型1111 / hstore(表:users,column:   设置)无法转换为Avro类型   org.apache.nifi.processors.standard.util.JdbcCommon.createSchema(JdbcCommon.java:621)     在   org.apache.nifi.processors.standard.util.JdbcCommon.convertToAvroStream(JdbcCommon.java:282)     在   org.apache.nifi.processors.standard.ExecuteSQL.lambda $ onTrigger $ 1(ExecuteSQL.java:245)     在   org.apache.nifi.controller.repository.StandardProcessSession.write(StandardProcessSession.java:2621)     在   org.apache.nifi.processors.standard.ExecuteSQL.onTrigger(ExecuteSQL.java:235)     在   org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)     在   org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1147)     在   org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:175)     在   org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent $ 1.run(TimerDrivenSchedulingAgent.java:117)     在   java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)     at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)     在   java.util.concurrent.ScheduledThreadPoolExecutor中的$ ScheduledFutureTask.access $ 301(ScheduledThreadPoolExecutor.java:180)     在   java.util.concurrent.ScheduledThreadPoolExecutor中的$ ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)     在   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)     在   java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:624)     在java.lang.Thread.run(Thread.java:748)2018-05-03 04:54:43,418 WARN   [定时器驱动的进程线程-6] o.a.n.controller.tasks.ConnectableTask   行政上屈服   由于未被捕获,ExecuteSQL [id = 1f22e067-0163-1000-ffff-ffff9c047041]   例外:java.lang.IllegalArgumentException:createSchema:未知   SQL类型1111 / hstore(表:users,column:settings)不能   转换为Avro类型java.lang.IllegalArgumentException:   createSchema:未知的SQL类型1111 / hstore(表:users,column:   设置)无法转换为Avro类型   org.apache.nifi.processors.standard.util.JdbcCommon.createSchema(JdbcCommon.java:621)     在   org.apache.nifi.processors.standard.util.JdbcCommon.convertToAvroStream(JdbcCommon.java:282)     在   org.apache.nifi.processors.standard.ExecuteSQL.lambda $ onTrigger $ 1(ExecuteSQL.java:245)     在   org.apache.nifi.controller.repository.StandardProcessSession.write(StandardProcessSession.java:2621)     在   org.apache.nifi.processors.standard.ExecuteSQL.onTrigger(ExecuteSQL.java:235)     在   org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)     在   org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1147)     在   org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:175)     在   org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent $ 1.run(TimerDrivenSchedulingAgent.java:117)     在   java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)     at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)     在   java.util.concurrent.ScheduledThreadPoolExecutor中的$ ScheduledFutureTask.access $ 301(ScheduledThreadPoolExecutor.java:180)     在   java.util.concurrent.ScheduledThreadPoolExecutor中的$ ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)     在   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)     在   java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:624)     at java.lang.Thread.run(Thread.java:748)2018-05-03 04:54:43,501 INFO   [Flow Service Tasks Thread-1] o.a.nifi.controller.StandardFlowService   保存的流量控制器   org.apache.nifi.controller.FlowController@65ee54e8 //另一个保存   pending = false 2018-05-03 04:54:44,423 ERROR [定时器驱动的过程   Thread-9] o.a.nifi.processors.standard.ExecuteSQL   的ExecuteSQL [ID = 1f22e067-0163-1000-FFFF-ffff9c047041]   ExecuteSQL [id = 1f22e067-0163-1000-ffff-ffff9c047041]无法处理   由于java.lang.IllegalArgumentException而导致的session:createSchema:   未知的SQL类型1111 / hstore(表:users,column:settings)不能   转换为Avro型;处理器在行政上产生1   sec:java.lang.IllegalArgumentException:createSchema:未知的SQL   类型1111 / hstore(表:用户,列:设置)不能   转换为Avro类型java.lang.IllegalArgumentException:   createSchema:未知的SQL类型1111 / hstore(表:users,column:   设置)无法转换为Avro类型   org.apache.nifi.processors.standard.util.JdbcCommon.createSchema(JdbcCommon.java:621)     在   org.apache.nifi.processors.standard.util.JdbcCommon.convertToAvroStream(JdbcCommon.java:282)     在   org.apache.nifi.processors.standard.ExecuteSQL.lambda $ onTrigger $ 1(ExecuteSQL.java:245)     在   org.apache.nifi.controller.repository.StandardProcessSession.write(StandardProcessSession.java:2621)     在   org.apache.nifi.processors.standard.ExecuteSQL.onTrigger(ExecuteSQL.java:235)     在   org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)     在   org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1147)     在   org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:175)     在   org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent $ 1.run(TimerDrivenSchedulingAgent.java:117)     在   java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)     at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)     在   java.util.concurrent.ScheduledThreadPoolExecutor中的$ ScheduledFutureTask.access $ 301(ScheduledThreadPoolExecutor.java:180)     在   java.util.concurrent.ScheduledThreadPoolExecutor中的$ ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)     在   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)     在   java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:624)     at java.lang.Thread.run(Thread.java:748)2018-05-03 04:54:4,423 WARN   [定时器驱动的进程线程-9] o.a.n.controller.tasks.ConnectableTask   行政上屈服   由于未被捕获,ExecuteSQL [id = 1f22e067-0163-1000-ffff-ffff9c047041]   例外:java.lang.IllegalArgumentException:createSchema:未知   SQL类型1111 / hstore(表:users,column:settings)不能   转换为Avro类型java.lang.IllegalArgumentException:   createSchema:未知的SQL类型1111 / hstore(表:users,column:   设置)无法转换为Avro类型   org.apache.nifi.processors.standard.util.JdbcCommon.createSchema(JdbcCommon.java:621)     在   org.apache.nifi.processors.standard.util.JdbcCommon.convertToAvroStream(JdbcCommon.java:282)     在   org.apache.nifi.processors.standard.ExecuteSQL.lambda $ onTrigger $ 1(ExecuteSQL.java:245)     在   org.apache.nifi.controller.repository.StandardProcessSession.write(StandardProcessSession.java:2621)     在   org.apache.nifi.processors.standard.ExecuteSQL.onTrigger(ExecuteSQL.java:235)     在   org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)     在   org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1147)     在   org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:175)     在   org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent $ 1.run(TimerDrivenSchedulingAgent.java:117)     在   java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)     at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)     在   java.util.concurrent.ScheduledThreadPoolExecutor中的$ ScheduledFutureTask.access $ 301(ScheduledThreadPoolExecutor.java:180)     在   java.util.concurrent.ScheduledThreadPoolExecutor中的$ ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)     在   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)     在   java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:624)     在java.lang.Thread.run(Thread.java:748)2018-05-03 04:54:45,427   错误[定时器驱动的过程线程-9]   o.a.nifi.processors.standard.ExecuteSQL   的ExecuteSQL [ID = 1f22e067-0163-1000-FFFF-ffff9c047041]   ExecuteSQL [id = 1f22e067-0163-1000-ffff-ffff9c047041]无法处理   由于java.lang.IllegalArgumentException而导致的session:createSchema:   未知的SQL类型1111 / hstore(表:users,column:settings)不能   转换为Avro型;处理器在行政上产生1   sec:java.lang.IllegalArgumentException:createSchema:未知的SQL   类型1111 / hstore(表:用户,列:设置)不能   转换为Avro类型java.lang.IllegalArgumentException:   createSchema:未知的SQL类型1111 / hstore(表:users,column:   设置)无法转换为Avro类型   org.apache.nifi.processors.standard.util.JdbcCommon.createSchema(JdbcCommon.java:621)     在   org.apache.nifi.processors.standard.util.JdbcCommon.convertToAvroStream(JdbcCommon.java:282)     在   org.apache.nifi.processors.standard.ExecuteSQL.lambda $ onTrigger $ 1(ExecuteSQL.java:245)     在   org.apache.nifi.controller.repository.StandardProcessSession.write(StandardProcessSession.java:2621)     在   org.apache.nifi.processors.standard.ExecuteSQL.onTrigger(ExecuteSQL.java:235)     在   org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)     在   org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1147)     在   org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:175)     在   org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent $ 1.run(TimerDrivenSchedulingAgent.java:117)     在   java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)     at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)     在   java.util.concurrent.ScheduledThreadPoolExecutor中的$ ScheduledFutureTask.access $ 301(ScheduledThreadPoolExecutor.java:180)     在   java.util.concurrent.ScheduledThreadPoolExecutor中的$ ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)     在   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)     在   java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:624)     在java.lang.Thread.run(Thread.java:748)

1 个答案:

答案 0 :(得分:0)

该问题应该在NiFi 1.9.0+中已解决(有关更多详细信息,请参见NIFI-5845