简体   繁体   English

如何在Carte上运行的Pentaho Kettle Job中使用变量作为数据库Log Connection名称?

[英]How to use variable for database Log Connection name in Pentaho Kettle Job running on Carte?

I would like to parametrize which (predefined and parametrized) log DB connection to use, eg data.import.log.db=LOG_DB : 我想参数化要使用的(预定义和参数化的)日志数据库连接,例如data.import.log.db=LOG_DB 在此处输入图片说明

but I can't get it to work with a job parameter data.import.log.db , or setting variable data.import.log.db in the calling parent job. 但我无法使其与作业参数data.import.log.db或在调用父作业中设置变量data.import.log.db一起使用。

The only way I see is setting the variable in kettle.properties, or as a variable from command line. 我看到的唯一方法是在Kettle.properties中设置变量,或者从命令行将其设置为变量。 But if the job executes in Carte, I would like the caller to decide on which log connection is to be used -- sometimes a caller decides to not log at all (empty variable). 但是,如果作业在Carte中执行,我希望调用者决定使用哪个日志连接-有时,调用者决定根本不登录(空变量)。 Am I missing something on how to hand over this variable to the job log connection? 我是否缺少有关如何将此变量移交给作业日志连接的信息?

Thanks in advance for constructive hints and explanations. 在此先感谢您的建设性提示和解释。

-- edit: using PDI CE 8.0.0-28. -编辑:使用PDI CE 8.0.0-28。

You cannot parametrise the connection name. 您无法参数化连接名称。

You can parametrise its properties (host, port, username, and password for example), but not the connection name itself. 您可以参数化其属性(例如,主机,端口,用户名和密码),但不能参数化连接名称本身。

I am afraid you cannot. 恐怕你不能。 The log parameters are defined early in the process, well before the variable of the job/transfo are read. 日志参数是在流程的早期定义的,远在读取job / transfo的变量之前。

What you can do is to log on a tmp table, and let the caller decide if it has to copy the table and where with a straightforward transformation. 您可以做的是登录一个tmp表,然后让调用者通过简单的转换来决定是否必须复制该表以及将其复制到何处。

The drawback of this method is for concurrent jobs. 此方法的缺点是并发作业。 The copy transformation then needs to take the decision based on the channel number. 然后,复制转换需要根据通道号做出决定。

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

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