将SQL查询结果存储在pentaho变量中

d2907

我是PDI的新手(从SSIS传递过来),并且在处理变量问题时遇到了一些麻烦。

我想执行以下操作:从sql select查询中,我想将结果保存到变量中。因此,我创建了一个作业和两个转换,因为在pentaho中,每个步骤都是并行执行的。

在此处输入图片说明

The first transformation is going to be on charge of setting the variable and the second transformation is going to use this result as an input. But in the first transformation I am having troubles by setting the variable, I do not understand where do I have to instanciate this variable to implement the "set season variable" step. And then how to get this result in the next transformation.

If anyone knows about this, or if you could recommend any link with a good example, I'll really appreciate it.

Brian.D.Myers

This can indeed be confusing for SSIS users. In PDI, you don't create a recordset variable as you do in SSIS. Simply creating a job creates one for you. Each job has two different types of "Results". One for recordset rows and one for filenames.

These variables are not directly accessible; they are just part of the job. There are steps that interact with them directly. For example under the "Job" branch when you're creating a transform, there is a Get rows from results step and a Copy rows to results step. They work directly with the job's row results.

Be aware that you must manually manage the metadata for the results. This is a pain, but over-all I find PDI's method of doing this more intuitive and easier than SSIS. I find SSIS more flexible in this regard.

There are also Get files from result and Set files in result. These interact with the job's built in file results. This is simply a list of every file touched by any step configured in the job. On the job tab there are tasks that deal with it directly such as Process result filenames, Add filenames to result and Delete filenames from results. These tasks operate on the built in file results list for the job and provide an easy way to, say, archive all the files loaded by the transform you just ran.

请注意,在使用这些步骤时,它们会记录作业中每个步骤所涉及的每个文件。如果您浏览处理文件的转换(数据流)中的大多数步骤,通常会选中“添加文件到结果”复选框。如果取消选中此选项,则不会将文件名添加到作业文件结果中。您也可以通过以下Delete filenames from result步骤从文件结果中删除特定文件

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

无法获得SQL查询以将结果存储到变量中

如何使用PHP将SQL查询结果存储在变量中?

将查询结果存储在 hive 变量中

将动态查询的结果存储在变量中

将第一个结果值存储到PHP中的sql查询变量中

将 sql 查询的结果存储到变量访问 vba

如何使用动态SQL(MySQL)将查询结果存储到局部变量中?

如何将 SQL 查询结果存储在 JavaScript 变量中以在全局范围内使用?

在PL / pgSQL中使用将查询结果存储在变量中

将选择查询的结果存储到数组变量中

将猫鼬查询结果存储在变量中

将Oracle查询结果存储到bash变量中

如何将查询结果存储在变量中

如何将SELECT查询的结果表存储在变量中?

如何将linq查询的结果存储在KeyDictionary变量中

SQL设置变量作为存储过程中查询的结果

将SQL查询的结果保存到本地SQL变量中

将查询结果存储为php变量

如何将动态SQL的结果存储在变量中?

如何将查询结果存储在MySql存储过程中的变量中

Qt:将SQL查询的结果保存在变量中,在SQL查询中使用C ++变量

使用postgresql存储过程将整个查询结果存储在变量中

如何将 SensorThings 查询结果存储到 JavaScript/jQuery 中的变量中

如何将查询结果存储到mysql中的变量中

将查询的结果存储在函数中

将 observable 的结果存储到变量中

将断言失败结果存储在变量中

将函数结果存储到变量中

将命令的结果存储在变量中