我是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.
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] 删除。
我来说两句