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

大憨熊 提交于 2019-12-20 04:10:15

问题


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: Cursors are not supported on a table which has a clustered columnstore index

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.

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

Thanks in advance.


回答1:


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

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.

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



来源:https://stackoverflow.com/questions/35411122/sqlexceptionhelper-cursors-are-not-supported-on-a-table-which-has-a-clustered-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!