使用Kettle的SQL输出步骤输出SQL脚本时,出现SQL脚本中的日期类型的数据格式不正确,且没有使用单引号括起来。修改DataBase的GetSQLOutput方法解决了此问题,在此方法中增加了对日期数据的处理,具体见下面代码有中文注释的哪一行。
package org.pentaho.di.core.database;
/**
* Database handles the process of connecting to, reading from, writing to and updating databases. The database specific
* parameters are defined in DatabaseInfo.
*
* @author Matt
* @since 05-04-2003
*/
public class Database implements VariableSpace, LoggingObjectInterface {
/**
* Return SQL statement (INSERT INTO TableName ...
*
* @param schemaName tableName The schema
* @param tableName
* @param fields
* @param dateFormat date format of field
* @throws KettleDatabaseException
*/
public String getSQLOutput( String schemaName, String tableName, RowMetaInter