[英]Fetching data from java api call from Pentaho Kettle Job
I have a Job in Pentaho. 我在Pentaho有一份工作。 The job has one transformation which returns back JSON Output.
该作业有一个转换返回JSON输出。 How do I access it using Java API?
如何使用Java API访问它? I need to read that JSON and print it.
我需要阅读JSON并打印出来。 My code is:
我的代码是:
KettleEnvironment.init();
JobMeta jobMeta = new JobMeta("Job.kjb", null);
Job job = new Job(null, jobMeta);
job.start();
job.waitUntilFinished()
System.out.println("dfffdgfdg: "+job.getResult());
Do i need to have row listener? 我需要有行监听器吗? but how to set it as the step is in KTR inside job.
但如何设置它作为步骤是在KTR内部工作。 I am completely confused.
我完全糊涂了。 Please help
请帮忙
In your last transformation ie KTR, dont forget to add the STEP - Copy rows to result. 在你的最后一次转换即KTR中,不要忘记添加STEP - 将行复制到结果中。 After that .. when you run the JOB through your Java .
之后..当您通过Java运行JOB时。 use following code to access result:
使用以下代码访问结果:
final List<RowMetaAndData> read;
read = job.getResult().getRows();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.