简体   繁体   English

Pentaho水壶的Java表达式

[英]Java expression for Pentaho Kettle

I m in a precarious situation. 我处境不稳定。 I am looking for a 'JAVA EXPRESSION' for replacing a defined 'place-holder' in kettle. 我正在寻找一种“ JAVA EXPRESSION”来代替水壶中定义的“占位符”。

My incoming string A is 我的传入字符串A是

<consumers>
 ?place-holder?
</consumers>

My incoming string Y is 我的传入字符串Y是

<consumer>
   <info>X</info> 
 </consumer> 

After substitution the final output must be 替换后,最终输出必须为

<consumers>
   <consumer>
     <info>X</info>
   </consumer>  
</consumers>

Basically I am substituting ?place-holder? 基本上,我要替换“占位符”? in 'String A' with 'String B'. 在“字符串A”和“字符串B”中。

Actually the data's volume is extremely high and hence 'javascript', 'calculator' & 'replace in string' and all other options that I have tried is pathetic in performance. 实际上,数据量非常大,因此我尝试过的“ javascript”,“ calculator”和“ replace in string”以及所有其他选项在性能上都是可悲的。

I have read that 'Java expressions' are high in performance. 我读过“ Java表达式”的性能很高。 Somehow, I am not able to come up with the expression. 不知何故,我无法提出这个表达。

Any help! 任何帮助!

Try it out. 试试看。 Self explained picture below 自我说明如下

在此处输入图片说明

Don't forget to check with java doc to string what expression does actually. 不要忘了用java doc检查字符串实际上是做什么的。

Replaces each substring of this string that matches the 替换此字符串匹配的每个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM