Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Reading Binary files

  1. #1
    Join Date
    Jun 2007
    Posts
    128

    Default Reading Binary files

    Hi,

    Is it possible to read data in binary files and load into a mysql database with kettle?How can we do this?
    Can we add custom transformation steps to Kettle?

    Thanks
    Sreelatha

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    There's even a example transformation in the samples directory (look for the Javascript samples in 2.5.2).

    And you can of course add your own steps if you want to. If they're general and any good you can even share them with the rest of the users (either as closed or open source).

    Regards,
    Sven

  3. #3
    Join Date
    Aug 2007
    Posts
    151

    Default

    I found this transformation in the Samples dir:

    data-integration/samples/transformations/General - Load images and store into database table.ktr

    The JS step has the following code which reads binary:

    file = new Packages.java.io.File(filename.getString());
    fileInputStream = new Packages.java.io.FileInputStream(file);
    var content = Packages.org.pentaho.di.core.Const.createByteArray(file.length());
    fileInputStream.read(content, 0, file.length());
    fileInputStream.close();

    Have fun,

    Fábio de Salles
    Serpro/Brazil

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.