gpt4 book ai didi

java - SqlExceptionHelper : Cursors are not supported on a table which has a clustered columnstore index

转载 作者:行者123 更新时间:2023-11-30 03:03:16 30 4
gpt4 key购买 nike

我正在尝试通过 flume 将使用聚集列存储索引的 DWH SQL Server 表中的数据导入到 kudu 中。但是,在我的自定义 flume 源从数据库中检索一定数量的行后,出现以下异常:

SqlExceptionHelper: Cursors are not supported on a table which has a clustered columnstore index

我正在使用 JDBC SQL Server 驱动程序类型 4,显然它使用游标来迭代结果集。因此,我尝试将获取大小设置为查询限制的数量,但没有任何改变。

如何阻止 JDBC 驱动程序使用游标,从而将所有行导入到 kudu 表中?

提前致谢。

最佳答案

尝试在连接属性中设置selectmethod=directSource :

If set to direct (the default), the database server sends the complete result set in a single response to the driver when responding to a query. A server-side database cursor is not created if the requested result set type is a forward-only result set. Typically, responses are not cached by the driver. Using this method, the driver must process the entire response to a query before another query is submitted. If another query is submitted (using a different statement on the same connection, for example), the driver caches the response to the first query before submitting the second query. Typically, the Direct method performs better than the Cursor method.

当然,您需要将结果集定义为 FORWARD_ONLY以保证这一点。

关于java - SqlExceptionHelper : Cursors are not supported on a table which has a clustered columnstore index,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35411122/

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