Pentaho

 View Only

 Pentaho pdi 9.4 MariaDB invalid fetch size

Junwei ZHOU's profile image
Junwei ZHOU posted 01-31-2023 02:44

I recently upgrade pentaho pdi from 9.0 to 9.4. Then I have the problem with mariaDB java connector. It gives me the error:

023/01/31 08:39:04 - Calculate new batch.0 - (conn=491187) invalid fetch size
2023/01/31 08:39:04 - Calculate new batch.0 -
2023/01/31 08:39:04 - Calculate new batch.0 - at org.pentaho.di.core.database.Database.openQuery(Database.java:1776)
2023/01/31 08:39:04 - Calculate new batch.0 - at org.pentaho.di.trans.steps.tableinput.TableInput.doQuery(TableInput.java:242)
2023/01/31 08:39:04 - Calculate new batch.0 - at org.pentaho.di.trans.steps.tableinput.TableInput.processRow(TableInput.java:143)
2023/01/31 08:39:04 - Calculate new batch.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2023/01/31 08:39:04 - Calculate new batch.0 - at java.lang.Thread.run(Unknown Source)
2023/01/31 08:39:04 - Calculate new batch.0 - Caused by: java.sql.SQLSyntaxErrorException: (conn=491187) invalid fetch size
2023/01/31 08:39:04 - Calculate new batch.0 - at org.mariadb.jdbc.export.ExceptionFactory.createException(ExceptionFactory.java:282)
2023/01/31 08:39:04 - Calculate new batch.0 - at org.mariadb.jdbc.export.ExceptionFactory.create(ExceptionFactory.java:336)
2023/01/31 08:39:04 - Calculate new batch.0 - at org.mariadb.jdbc.Statement.setFetchSize(Statement.java:587)
2023/01/31 08:39:04 - Calculate new batch.0 - at org.penta

Petr Prochazka's profile image
Petr Prochazka
Hi Junwei,
this behaviour is with MariaDB JDBC v3.x. In PDI are prehistoric hacks for MySQL JDBC v3.
I see this solutions:
  1. Downgrade to previous major version of MariaDB driver.
  2. Define connection attribute in transformation: STREAM_RESULTS=N. I don't known if this can have consequences for performance or unexpected behaviour.
    Unfortunately this parameter can not be set in UI. This is a fragment in XML:
      <connection>
        [...]
        <attributes>
          [...]
          <attribute>
            <code>STREAM_RESULTS</code>
            <attribute>N</attribute>
          </attribute>
        </attributes>
      </connection>
    ​
  3. Create plugin with own MariaDB database type and disable flag for detecting MySQL variant database type.
Junwei ZHOU's profile image
Junwei ZHOU
Update to this issue.


I have resolved the issue by downgrade mariaDB java connector from 3.x.x to 2.7.x version. Then it works without any issue.