问题
How can I get all possible combination of words through pentaho kettle. Is there a step that does this?
For example - if I have 3 word Apple , Banana , Orange
I need all unique combinations of those words I.e.
- comb1 = Apple ;
- Comb2 = Banana ;
- Comb3 = Orange ;
- Comb4 = Apple + Banana ;
- Comb5 = Apple + Orange ;
- Comb6 = Banana + Orange ;
- Comb7 = Banana + Apple ;
- Comb8 = Orange + Apple ;
- Comb9 = Orange + Banana ;
- Comb10 = Apple + Banana + Orange ;
- Comb11 = Apple + Orange + Banana ;
- Comb12 = Banana + Orange + Apple ;
- Comb13 = Banana + Apple + Orange ;
- Comb14 = Orange + Apple + Banana ;
- Comb15 = Orange + Banana + Apple ;
I need this to be dynamic I.e. combination to be generated depending upon a no of words supplied.
Thanks!
回答1:
In PDI you need to use 'Modified Java Script Value' step. Because there have no default PDI step to do that. I have prepared a transformation for you. You can get help from this transformation. Link
来源:https://stackoverflow.com/questions/63799395/pentaho-kettle-get-all-combination-of-words