Pentaho 数据集成错误 - '' 附近的语法不正确

Pentaho Data Intergration Error - Incorrect syntax near ''

我正在尝试将一些数据从 csv 文件加载到 SQL 服务器中的 table。我收到一个语法错误,告诉我“''”附近有问题。那是中间有零宽度不间断 space 的撇号。

我检查了一下,我尝试加载的数据中没有这个字符。

这是 Pentaho 显示的错误。

2020/03/19 19:06:23 - SMS Output.0 - ERROR (version 8.3.0.0-371, build 8.3.0.0-371 from 2019-06-11 11.09.08 by buildguy) : Because of an error, this step can't continue:
2020/03/19 19:06:23 - SMS Output.0 - ERROR (version 8.3.0.0-371, build 8.3.0.0-371 from 2019-06-11 11.09.08 by buildguy) : org.pentaho.di.core.exception.KettleException: 
2020/03/19 19:06:23 - SMS Output.0 - Error batch inserting rows into table [DailySMS].
2020/03/19 19:06:23 - SMS Output.0 - Errors encountered (first 10):
2020/03/19 19:06:23 - SMS Output.0 - Incorrect syntax near ''.
2020/03/19 19:06:23 - SMS Output.0 - Incorrect syntax near ''.
2020/03/19 19:06:23 - SMS Output.0 - Incorrect syntax near ''.
2020/03/19 19:06:23 - SMS Output.0 - Incorrect syntax near ''.
2020/03/19 19:06:23 - SMS Output.0 - Incorrect syntax near ''.
2020/03/19 19:06:23 - SMS Output.0 - Incorrect syntax near ''.
2020/03/19 19:06:23 - SMS Output.0 - Incorrect syntax near ''.
2020/03/19 19:06:23 - SMS Output.0 - Incorrect syntax near ''.
2020/03/19 19:06:23 - SMS Output.0 - Incorrect syntax near ''.
2020/03/19 19:06:23 - SMS Output.0 - Incorrect syntax near ''.
2020/03/19 19:06:23 - SMS Output.0 - 
2020/03/19 19:06:23 - SMS Output.0 - 
2020/03/19 19:06:23 - SMS Output.0 - Error updating batch
2020/03/19 19:06:23 - SMS Output.0 - Incorrect syntax near ''.
2020/03/19 19:06:23 - SMS Output.0 - 
2020/03/19 19:06:23 - SMS Output.0 - 
2020/03/19 19:06:23 - SMS Output.0 -    at org.pentaho.di.trans.steps.tableoutput.TableOutput.writeToTable(TableOutput.java:348)
2020/03/19 19:06:23 - SMS Output.0 -    at org.pentaho.di.trans.steps.tableoutput.TableOutput.processRow(TableOutput.java:125)
2020/03/19 19:06:23 - SMS Output.0 -    at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2020/03/19 19:06:23 - SMS Output.0 -    at java.lang.Thread.run(Unknown Source)
2020/03/19 19:06:23 - SMS Output.0 - Caused by: org.pentaho.di.core.exception.KettleDatabaseBatchException: 
2020/03/19 19:06:23 - SMS Output.0 - Error updating batch
2020/03/19 19:06:23 - SMS Output.0 - Incorrect syntax near ''.
2020/03/19 19:06:23 - SMS Output.0 - 
2020/03/19 19:06:23 - SMS Output.0 -    at org.pentaho.di.core.database.Database.createKettleDatabaseBatchException(Database.java:1430)
2020/03/19 19:06:23 - SMS Output.0 -    at org.pentaho.di.trans.steps.tableoutput.TableOutput.writeToTable(TableOutput.java:295)
2020/03/19 19:06:23 - SMS Output.0 -    ... 3 more
2020/03/19 19:06:23 - SMS Output.0 - Caused by: java.sql.BatchUpdateException: Incorrect syntax near ''.
2020/03/19 19:06:23 - SMS Output.0 -    at net.sourceforge.jtds.jdbc.JtdsStatement.executeBatch(JtdsStatement.java:1069)
2020/03/19 19:06:23 - SMS Output.0 -    at org.pentaho.di.trans.steps.tableoutput.TableOutput.writeToTable(TableOutput.java:291)
2020/03/19 19:06:23 - SMS Output.0 -    ... 3 more
2020/03/19 19:06:23 - CargaSMS - ERROR (version 8.3.0.0-371, build 8.3.0.0-371 from 2019-06-11 11.09.08 by buildguy) : Errors detected!

我尝试更改数据字段类型以查看是否有帮助,但仍然显示此错误。

Pentaho 版本 8.3

SQL 服务器 2008

编辑1

我正在处理的文件被编码为 UTF-8-BOM。我尝试按照用户的建议将它们转换为 UTF-8,但没有成功。我开始怀疑这些文件与此无关。

我尝试使用 Pentaho 创建一个新的 table。

CREATE TABLE dbo.DailySMS_test2
(
  celular VARCHAR(15)
, msg VARCHAR(149)
, id VARCHAR(15)
, status VARCHAR(100)
, DateSent VARCHAR(100)
)
;

我遇到了同样的错误

Incorrect syntax near ''.

我也尝试将 Pentaho 生成的查询复制到 SSMS 中,但出现了这个错误:

Msg 102, Level 15, State 1, Line 3
Incorrect syntax near ''.

我能够通过重命名第一列解决这个问题,从而删除零宽度不间断 space。

我尝试使用 Pentaho 读取的文件编码是 UTF-8-BOM,但是 Pentaho 没有读取 UTF-8-BOM 的选项,只有 UTF-8。所以它只是将零宽度不间断 space 添加到文件的开头,这是第一列的名称。

所以,通过重命名第一列,或者简单地删除第一个字母之前的一个字符,这个问题就解决了。