Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Passing parameters to Filter Rows

  1. #1

    Question Passing parameters to Filter Rows

    Hi,

    I'm using the "Filter Rows" step in a transformation and I didn't find how to pass parameters to the fields, in other words, i need to bind some values during the transformation execution.

    Example:

    Select * from table1
    where field1 = ? and
    field2 > ?

    How can I do this?

    Regards,
    Fernando Cesar.

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

    Default

    Filter rows works on rows, not on databases:

    So you could do:
    1) Select * from table1 in a table input
    2) Use the filter rows to simulate the where clause

    If you want to compare fields in the database to extra parameters you could add them after the initial table input with e.g. a get variables step. The fields/values to compare against have to be in the stream.

    But it would be faster to just use the complete query in a table input step, it will save you a lot of IO.

    Regards,
    Sven
    Last edited by sboden; 07-17-2007 at 07:46 AM.

  3. #3

    Default

    Sven,

    Let me clarify. I already have a "Table Input" step. (look at attached image)

    The "Filter Rows" step will receive the rows from the previous step and I have to make the filter using parameters binding at runtime. You mentioned the "Add constants" step, but I need to somehow pass variables values, not constant values.

    Is it clearer?

    Is it possible to do this?

    Regards,
    Fernando Cesar.
    Attached Images Attached Images  

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

    Default

    Get variables step, not add constant. But if your filter is right after the table input, just remove the filter and use the binding in the table input (as you wrote the SQL in the original post). You can make table input accept parameters from a previous step, in a previous step you could get them from 'kettle' variables, files, ...

    "Problem" with filter steps is that it's not very variable sensitive, so if you want to compare fields from your table input with something, you first have to insert "this something" in the stream somehow.

    Regards,
    Sven

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.