Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Passing multi value list from PRD to PDI (Spoon)

  1. #1
    Join Date
    Dec 2012
    Posts
    121

    Default Passing multi value list from PRD to PDI (Spoon)

    Hi, i have a report on which i have defined a multi value list parameter, called x.
    Now i want to pass it to a kettle transformation. The transformation does not recognize the type (a string)!!

    Any ideas?
    Thanks

  2. #2
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Kettle's parameter system is rather primitive, so you have to convert your parameter value into a single, parseable string in PRD first (serialize it), then pass that string down to kettle, and then deserialize/parse that string back into an array inside your KTR.

    Reason for that: Kettle's parameter system is primitive and untyped, it only accepts strings and no other complex or compound data-types.

    So create a hidden parameter in PRD and add the following post-processing formula:

    =CSVTEXT([mselect], TRUE())

    and pass the hidden parameter to kettle. Inside Kettle then use a formula step to parse that string.

    =CSVARRAY([param], TRUE())


    Note that this only works safely with string (and maybe numeric) multi-select parameters. Dont try this with dates.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  3. #3
    Join Date
    Dec 2012
    Posts
    121

    Default

    Thanks,
    but i have resolved using a copy of my param and setting it the post processing formual to: =SEQUENCEQUOTER([original_param];";";"")

    Yamas

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

    Default

    I think Kettle will always be just accepting Strings as parameters. The parameter system is not primitive. It just works always as expected, with the correct locality and inheritance versus transformations and jobs, and doesn't assume functionality where none can be assumed. It doesn't hint at hidden conversion logic and doesn't impose UI elements to manage the various data types that are supposedly supported (until you hit a data type that isn't).

  5. #5
    Join Date
    Jun 2007
    Posts
    476

    Default

    Quote Originally Posted by marcolino View Post
    Thanks,
    but i have resolved using a copy of my param and setting it the post processing formual to: =SEQUENCEQUOTER([original_param];";";"")

    Yamas
    I know this is an old thread (a couple of months old) but I wanted you to beware that, depending on how you are using your parameters in PDI, this could be a potential SQL Injection prone solution.
    Rodrigo Haces
    TAM / Enterprise Architect
    Pentaho

Tags for this Thread

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.