Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: Add fields to stream

  1. #1

    Default Add fields to stream

    Hi,

    I have a job where I read data from a file and insert data into a database table, using the following steps:

    Text file input > Map Columns > Table Output.

    Fields in the table:

    f1
    f2
    f3

    So far so good.

    Now I'd like to update the job such that every row inserted has an additional two fields in it. These will be constants. i.e.
    f1 - this is derived from file
    f2 - this is derived from file
    f3 - this is derived from file
    f4 - constant
    f5 - constant

    I have added an Add Constant step that feeds into the Map Columns step but I am getting the error message:

    Map Columns.0 - Couldn't find field 'f4' in row!

    Do I need some sorted on join step or am I using the wrong approach all together.

    Many thanks for any help
    Zimm

  2. #2
    Join Date
    Sep 2011
    Posts
    190

    Default

    Quote Originally Posted by Zimm View Post
    I have added an Add Constant step that feeds into the Map Columns step but I am getting the error message:
    It should be in the stream, so your stream should flow 'through' the Add Constant step, is that what you have done?

  3. #3
    Join Date
    Aug 2011
    Posts
    15

    Default

    Hi Zimm,


    May i know what version you are using??


    Regards
    Ashwin Ganesh.R

  4. #4

    Default

    If you use the "Add constant step" use a version > 4.1.2. Before the step was a bit buggy.

  5. #5
    Join Date
    Apr 2007
    Posts
    2,010

    Default

    eh? Add constants has been there since the year dot, and i've never found any bugs with it!?? Very strange!

  6. #6
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    It could be that it had a bug at some point, but there's no registered one since the 2.x series.

  7. #7

    Default

    Thanks to everyone. I followed mbvt's advice and it worked like a dream.

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.