IBM Support

Error when returning more than 256 rows from Netezza via JDBC driver to KNIME

Question & Answer


Question

Why do I receive the following from KNIME when trying to extract many records from the Netezza Database? ERROR     Database Reader                Execute failed: Encountered duplicate row ID  "Row0" at row number 257 .

Cause

Knime has a Dknime.database.fetchsize within the knime.ini file that is set.

Also within the Windows ODBC Configuration under the Start -> Control Panel -> Administrative Tools ->
Data Sources(ODBC) Driver Options we have the default Prefetch Count Size = 256 by default


Answer

You can update the knime.ini file, adding the following line:

-Dknime.database.fetchsize=0 Basically turning off the 256 limit.


You can also change this variable to a value of the amount of rows you would like to bring back say 10,000 as an example.

-Dknime.database.fetchsize= 10000

You can also under the Drive Options of the ODBC Configuration file change or adjust the PREFETCH Count. Note : This numeric value that sets the number of rows the driver fetches at a time from a Netezza database. The default is 256 rows. To tune your application, set a value that optimizes network use versus memory use. The higher this value, the more memory is required to hold these rows





You can also change/modify the contents of the sample file to configure your own .odbcinst.ini file.
[ODBC Drivers]
NetezzaSQL = Installed
[ODBC Connection Pooling]
PerfMon = 0
Retry Wait =
[NetezzaSQL]
Driver = /usr/local/nz/lib/libnzodbc.so
Setup = /usr/local/nz/lib/libnzodbc.so
APILevel = 1
ConnectFunctions = YYN
Description = Netezza ODBC driver
---
----
PreFetch = 256 <<<<------ Note you can change the PreFetch here.
Socket = 8192

Related Information

[{"Product":{"code":"SSULQD","label":"IBM PureData System"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"--","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
17 October 2019

UID

swg21962108