Mycat批量插入报错

发布于 2021-12-07 10:21:57 字数 3119 浏览 814 评论 2

批量插入使用注解

/*!mycat:catlet=demo.catlets.BatchInsertSequence */
INSERT INTO unit (id,name)
VALUES
(next VALUE FOR UNIT,'1'),
(next VALUE FOR UNIT,'2'),
(next VALUE FOR UNIT,'3'),
(next VALUE FOR UNIT,'4')

查看日志报错

05/19 10:20:10.034  ERROR [$_NIOREACTOR-4-RW] (BatchInsertSequence.java:119) -BatchInsertSequence.route(......)
java.lang.NullPointerException
	at demo.catlets.BatchInsertSequence.route(BatchInsertSequence.java:87)
	at org.opencloudb.route.handler.HintCatletHandler.route(HintCatletHandler.java:52)
	at org.opencloudb.route.RouteService.route(RouteService.java:107)
	at org.opencloudb.server.ServerConnection.routeEndExecuteSQL(ServerConnection.java:201)
	at org.opencloudb.server.ServerConnection.execute(ServerConnection.java:154)
	at org.opencloudb.server.ServerQueryHandler.query(ServerQueryHandler.java:120)
	at org.opencloudb.net.FrontendConnection.query(FrontendConnection.java:319)
	at org.opencloudb.net.handler.FrontendCommandHandler.handle(FrontendCommandHandler.java:71)
	at org.opencloudb.net.FrontendConnection.rawHandle(FrontendConnection.java:456)
	at org.opencloudb.net.FrontendConnection.handle(FrontendConnection.java:434)
	at org.opencloudb.net.AbstractConnection.onReadData(AbstractConnection.java:307)
	at org.opencloudb.net.NIOSocketWR.asynRead(NIOSocketWR.java:186)
	at org.opencloudb.net.AbstractConnection.asynRead(AbstractConnection.java:268)
	at org.opencloudb.net.NIOReactor$RW.run(NIOReactor.java:96)
	at java.lang.Thread.run(Thread.java:745)
05/19 10:20:10.035  ERROR [$_NIOREACTOR-4-RW] (BatchInsertSequence.java:131) -BatchInsertSequence.getRoute(String sql)
java.lang.NullPointerException
05/19 10:20:10.036  ERROR [$_NIOREACTOR-4-RW] (BatchInsertSequence.java:64) -BatchInsertSequence.processSQL(String sql, EngineCtx ctx)
java.lang.NullPointerException
	at demo.catlets.BatchInsertSequence.processSQL(BatchInsertSequence.java:52)
	at org.opencloudb.route.handler.HintCatletHandler.route(HintCatletHandler.java:53)
	at org.opencloudb.route.RouteService.route(RouteService.java:107)
	at org.opencloudb.server.ServerConnection.routeEndExecuteSQL(ServerConnection.java:201)
	at org.opencloudb.server.ServerConnection.execute(ServerConnection.java:154)
	at org.opencloudb.server.ServerQueryHandler.query(ServerQueryHandler.java:120)
	at org.opencloudb.net.FrontendConnection.query(FrontendConnection.java:319)
	at org.opencloudb.net.handler.FrontendCommandHandler.handle(FrontendCommandHandler.java:71)
	at org.opencloudb.net.FrontendConnection.rawHandle(FrontendConnection.java:456)
	at org.opencloudb.net.FrontendConnection.handle(FrontendConnection.java:434)
	at org.opencloudb.net.AbstractConnection.onReadData(AbstractConnection.java:307)
	at org.opencloudb.net.NIOSocketWR.asynRead(NIOSocketWR.java:186)
	at org.opencloudb.net.AbstractConnection.asynRead(AbstractConnection.java:268)
	at org.opencloudb.net.NIOReactor$RW.run(NIOReactor.java:96)
	at java.lang.Thread.run(Thread.java:745)

何解?求大神解答,是我的语句有问题吗

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

躲猫猫 2021-12-08 16:21:32

可能是没找到对应的序列值,你用的本地文件方式还是数据库的方式?

夜无邪 2021-12-08 12:48:46

不支持insert into

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文