Pentaho

 View Only

 Kettle: File existed but CSV file input step cannot open

  • Pentaho
  • Kettle
  • Pentaho
  • Pentaho Data Integration PDI
bewith you's profile image
bewith you posted 06-28-2019 10:33

Hi all

I'm new to PDI, I have a problem while reading csv file via CSV file input as bellow:

I simply created a transform to read and output csv file and it works fine when run on local path. But when I put it and csv file on same directory on Repository and change CSV file input file name from d:\test\abc.csv to  ${Internal.Entry.Current.Directory}/abc.csv ( also use absolute path to csv file: /home/test/abc.csv ), an error occured.

Any help or suggest to solve this issue to me?.

Tks!

Error log:

2019/06/28 16:54:38 - CSV file input.0 - An error occurred while creating field mapping

2019/06/28 16:54:38 - CSV file input.0 - Could not read from "file:///D:/home/test/abc.csv" because it is not a file.2019/06/28 16:54:38 - CSV file input.0 - 2019/06/28 16:54:38 - CSV file input.0 - Could not read from "file:///D:/home/test/abc.csv" because it is not a file.2019/06/28 16:54:38 - CSV file input.0 - 2019/06/28 16:54:38 - CSV file input.0 - at org.pentaho.di.trans.steps.csvinput.CsvInput.readFieldNamesFromFile(CsvInput.java:463)2019/06/28 16:54:38 - CSV file input.0 - at org.pentaho.di.trans.steps.csvinput.CsvInput.createFieldMapping(CsvInput.java:427)2019/06/28 16:54:38 - CSV file input.0 - at org.pentaho.di.trans.steps.csvinput.CsvInput.openNextFile(CsvInput.java:332)2019/06/28 16:54:38 - CSV file input.0 - at org.pentaho.di.trans.steps.csvinput.CsvInput.processRow(CsvInput.java:135)2019/06/28 16:54:38 - CSV file input.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)2019/06/28 16:54:38 - CSV file input.0 - at java.lang.Thread.run(Unknown Source)2019/06/28 16:54:38 - CSV file input.0 - Caused by: org.apache.commons.vfs2.FileNotFoundException: Could not read from "file:///D:/home/test/abc.csv" because it is not a file.2019/06/28 16:54:38 - CSV file input.0 - at org.apache.commons.vfs2.provider.AbstractFileObject.getInputStream(AbstractFileObject.java:1123)2019/06/28 16:54:38 - CSV file input.0 - at org.apache.commons.vfs2.provider.DefaultFileContent.getInputStream(DefaultFileContent.java:349)2019/06/28 16:54:38 - CSV file input.0 - at org.pentaho.di.core.vfs.KettleVFS.getInputStream(KettleVFS.java:263)2019/06/28 16:54:38 - CSV file input.0 - at org.pentaho.di.trans.steps.csvinput.CsvInput.readFieldNamesFromFile(CsvInput.java:443)2019/06/28 16:54:38 - CSV file input.0 - ... 5 more2019/06/28 16:54:38 - CSV file input.0 - Caused by: java.io.FileNotFoundException: D:/home/test/abc.csv (The system cannot find the file specified)2019/06/28 16:54:38 - CSV file input.0 - at java.io.FileInputStream.open0(Native Method)2019/06/28 16:54:38 - CSV file input.0 - at java.io.FileInputStream.open(Unknown Source)2019/06/28 16:54:38 - CSV file input.0 - at java.io.FileInputStream.<init>(Unknown Source)


#PentahoDataIntegrationPDI
#Kettle
#Pentaho
Luciano Donazzolo's profile image
Luciano Donazzolo

1. Define a global variable pointing to your File System Repository

  • Spoon
  • Edit
  • Edit the kettle.properties file
  • insert a new variable (e.g. Variable name = REPO_DIR  Value = /home/test )

2. Access the file in input step with: ${REPO_DIR}/abc.csv

Luciano