我有一个excel文件,我想用Switch / case
过滤。名为error
的转型:
收益:
2018/03/01 11:48:00 - Spoon - Using legacy execution engine
2018/03/01 11:48:00 - Spoon - Transformation opened.
2018/03/01 11:48:00 - Spoon - Launching transformation [error]...
2018/03/01 11:48:00 - Spoon - Started the transformation execution.
2018/03/01 11:48:00 - error - Dispatching started for transformation [error]
2018/03/01 11:48:00 - Microsoft Excel Input.0 - Finished processing (I=108, O=0, R=0, W=108, U=0, E=0)
2018/03/01 11:48:00 - Switch / case.0 - Finished processing (I=0, O=0, R=108, W=108, U=0, E=0)
2018/03/01 11:48:00 - Dummy (do nothing).0 - Finished processing (I=0, O=0, R=108, W=108, U=0, E=0)
2018/03/01 11:48:00 - Spoon - The transformation has finished!!
什么时候跑。但它会抛出错误:
2018/03/01 11:49:07 - error - Dispatching started for transformation [error]
2018/03/01 11:49:07 - Switch / case.0 - ERROR (version 8.0.0.0-28, build 8.0.0.0-28 from 2017-11-05 07.27.50 by buildguy) : Unexpected error
2018/03/01 11:49:07 - Switch / case.0 - ERROR (version 8.0.0.0-28, build 8.0.0.0-28 from 2017-11-05 07.27.50 by buildguy) : java.lang.NullPointerException
2018/03/01 11:49:07 - Switch / case.0 - at org.pentaho.di.trans.step.BaseStep.safeModeChecking(BaseStep.java:2129)
2018/03/01 11:49:07 - Switch / case.0 - at org.pentaho.di.trans.step.BaseStep.handleGetRow(BaseStep.java:1942)
2018/03/01 11:49:07 - Switch / case.0 - at org.pentaho.di.trans.step.BaseStep.access$100(BaseStep.java:147)
2018/03/01 11:49:07 - Switch / case.0 - at org.pentaho.di.trans.step.BaseStep$DefaultRowHandler.getRow(BaseStep.java:4180)
2018/03/01 11:49:07 - Switch / case.0 - at org.pentaho.di.trans.step.BaseStep.getRow(BaseStep.java:1797)
2018/03/01 11:49:07 - Switch / case.0 - at org.pentaho.di.trans.steps.switchcase.SwitchCase.processRow(SwitchCase.java:65)
2018/03/01 11:49:07 - Switch / case.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2018/03/01 11:49:07 - Switch / case.0 - at java.lang.Thread.run(Thread.java:748)
2018/03/01 11:49:07 - Switch / case.0 - Finished processing (I=0, O=0, R=1, W=0, U=0, E=1)
2018/03/01 11:49:07 - Microsoft Excel Input.0 - Finished processing (I=11, O=0, R=0, W=10, U=0, E=0)
2018/03/01 11:49:07 - error - Transformation detected one or more steps with errors.
2018/03/01 11:49:07 - error - Transformation is killing the other steps!
2018/03/01 11:49:07 - error - ERROR (version 8.0.0.0-28, build 8.0.0.0-28 from 2017-11-05 07.27.50 by buildguy) : Errors detected!
2018/03/01 11:49:07 - Spoon - The transformation has finished!!
2018/03/01 11:49:07 - error - ERROR (version 8.0.0.0-28, build 8.0.0.0-28 from 2017-11-05 07.27.50 by buildguy) : Errors detected!
2018/03/01 11:49:07 - error - ERROR (version 8.0.0.0-28, build 8.0.0.0-28 from 2017-11-05 07.27.50 by buildguy) : Errors detected!
当右键单击/预览...用于任何步骤时,我无法在Switch / case
之后的任何步骤中预览数据。而Preview data
下面的Execution Results
标签可以在所有步骤中预览数据。
我试图用Generate Rows
步骤或使用另一个文件重现错误,但我没有成功,所以这似乎表明Switch / case
不喜欢我的特定文件,我目前无法确定。
为什么会这样?我怎样才能防止它发生?
问题是我在Microsoft Excel Input
步骤中有一个空名字段。我将其重命名为实际包含非空字符串,问题已解决。