Pentaho kettle - get all combination of words

随声附和 提交于 2021-01-29 20:01:33

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!