SqlExceptionHelper:具有聚集的列存储索引的表不支持游标 [英] SqlExceptionHelper: Cursors are not supported on a table which has a clustered columnstore index

查看:202
本文介绍了SqlExceptionHelper:具有聚集的列存储索引的表不支持游标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从DWH SQL Server表导入数据,该表使用群集列存储索引通过flumekudu.但是,在我的自定义flume源从数据库中检索到一定数量的行之后,就会发生此异常:

I'm trying to import data from DWH SQL server table which is using Clustered Columnstore Index into kudu through flume. However, after my custom flume source retrieves a certain number of rows from the database, this exception occurs:

SqlExceptionHelper:具有聚集的列存储索引的表不支持游标

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

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

I'm using JDBC SQL Server driver type 4, and apparently it uses cursors to iterate resultset. Therefore, I tried setting fetch size to the number the query is limited to, but nothing changed.

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

How can I stop the JDBC driver from using cursors and thus get all rows imported into a kudu table?

谢谢.

推荐答案

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

Try setting selectmethod=direct in the connection properties. Source:

如果设置为direct(缺省值),则数据库服务器在响应查询时以单个响应的形式将完整结果集发送给驱动程序. 如果请求的结果集类型为仅转发结果集,则不会创建服务器端数据库游标.通常,驱动程序不缓存响应.使用此方法,驱动程序必须在提交另一个查询之前处理对查询的整个响应.如果提交了另一个查询(例如,在同一连接上使用不同的语句),驱动程序将在提交第二个查询之前缓存对第一个查询的响应.通常,直接方法的性能要优于游标方法.

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 对此进行保证.

Of course you need to define your resultset as FORWARD_ONLY to guarantee this.

这篇关于SqlExceptionHelper:具有聚集的列存储索引的表不支持游标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆