0

I have created a transformation in Pentaho Kettle where I am pulling some data from Mongo Collection, via Mongo Input, but the problem I am facing is I have created two named parameters in the same transformation and they are not being replaced in Mongo Query Expression Tab. Below is my mongo query expression:

{$and:[{'key1':{'$in':['${para1}']}},{'key2':{'$in':['${para2}']}}]}

Below are the two options I have tried from command line:

./pan.sh -file='/dir../pull_data.ktr' -param:para1=hello -param:para2=world -Level=Basic > /dir../etl.log

./pan.sh -file='/dir../pull_data.ktr' -param:"para1=hello" -param:"para2=world" -Level=Basic > /dir../etl.log

I am using Mac OSX and Pentaho Kettle (CE 5.2). Is it possible to use named parameters in the same transformation?

Cœur
  • 37,241
  • 25
  • 195
  • 267
andy
  • 41
  • 1
  • 8

1 Answers1

0

Use ./pan.sh -file='/dir../pull_data.ktr' -listparam to make sure you declared your parameters in the transformation settings.

Variable substitution inside of the JSON query should work AFAICS in the source code.

marabu
  • 1,166
  • 7
  • 9
  • Yes, they are defined in the parameters tab. I already checked that. Do you think anything other things going wrong here? – andy Apr 04 '17 at 11:07
  • The first commit on github for pentaho-mongodb-plugin was 2014-08-07 and has variable substitution already in place. PDI-CE-5.2 was published 2014-10-06. Can you check the timestamp of your plugin? Else I'll have to inspect the ZIP file to see what version of the plugin was packaged. – marabu Apr 04 '17 at 12:41
  • it is 30th September,2014. – andy Apr 04 '17 at 12:57
  • seems like mongodb plugin is removed from CE versions. check below commit https://github.com/pentaho/pentaho-kettle/search?q=mongo&type=Commits&utf8=%E2%9C%93 – andy Apr 04 '17 at 14:21