Yes, this is one way howto change behaviour, replace this class by
Or create database plugin jar and this add to plugins directory, ex. plugins/databases/db2-custom.jar
.
Example plugin jar is as attachment. This plugin replace original implementation of DB2 metadata.
package org.pentaho.di.core.database;
import org.pentaho.di.core.plugins.DatabaseMetaPlugin;
/**
* Custom DB2 Database meta.
*
* @author Petr Procházka (petrprochy)
*/
@DatabaseMetaPlugin(type = "DB2", typeDescription = "IBM D2")
public class CustomDB2DatabaseMeta extends DB2DatabaseMeta {
@Override
public String getTruncateTableStatement(String tableName) {
return "TRUNCATE TABLE " + tableName;
}
}
After you can check plugin list in PDI (I have custom MariaDB database meta) and see some similar for DB2 that meta is loaded from jar file.