zoukankan      html  css  js  c++  java
  • kettle用户手册(7:变量)

    我觉得这一章是比较重要的,在kettle中定义变量。

    变量可以用在PDI的任何地方,包括转换和job。

    通过set Variable在转换或者job中设置变量,也可以设置在kettle.properties文件中,不过,kettle.properties文件要放在以下位置:

    $HOME/.kettle (Unix/Linux/OSX)
    C:\Documents and Settings\<username>\.kettle\ (Windows)
    C:\Users\<username>\.kettle\ (Windows Vista)
    
    我们可以通过使用“Get Variable”step(在job里)来获取变量。
    也可以通过•${VARIABLE}(unix)或者•%%VARIABLE%%(windows)获取变量。这两种方式甚至可以混用。


    变量的作用域:
    环境变量(不建议用)

    The first usage (and only usage in previous Kettle versions) was to set an environment variable. Traditionally, this was accomplished by passing options to the Java Virtual Machine (JVM) with the -D option. It's also an easy way to specify the location of temporary files in a platform independent way, for example using variable ${java.io.tmpdir}. This variable points to directory /tmp on Unix/Linux/OSX and to C:\Documents and Settings\<username\Local Settings\Temp on Windows machines. The only problem with using environment variables is that the usage is not dynamic and problems arise if you try to use them in a dynamic way. For example, if you run two or more transformations or jobs run at the same time on an application server (for example the Pentaho platform) you get conflicts. Changes to the environment variables are visible to all software running on the virtual machine.

    kettle变量:

    内部已有变量:

    下面的变量是已经定义的:

    The following variables are always defined:

    Variable NameSample value
    Internal.Kettle.Build.Date 2007/05/22 18:01:39
    Internal.Kettle.Build.Version 2045
    Internal.Kettle.Version 2.5.0

    These variables are defined in a transformation:

    Variable NameSample value
    Internal.Transformation.Filename.Directory D:\Kettle\samples
    Internal.Transformation.Filename.Name Denormaliser - 2 series of key-value pairs.ktr
    Internal.Transformation.Name Denormaliser - 2 series of key-value pairs sample
    Internal.Transformation.Repository.Directory /

    These are the internal variables that are defined in a Job:

    Variable NameSample value
    Internal.Job.Filename.Directory /home/matt/jobs
    Internal.Job.Filename.Name Nested jobs.kjb
    Internal.Job.Name Nested job test case
    Internal.Job.Repository.Directory /

    These variables are defined in a transformation running on a slave server, executed in clustered mode:

    Variable NameSample value
    Internal.Slave.Transformation.Number 0..<cluster size-1> (0,1,2,3 or 4)
    Internal.Cluster.Size <cluster size> (5)




  • 相关阅读:
    MarkDown语法总结
    HashMap
    [LeetCode] 102. Binary Tree Level Order Traversal(二叉树的中序遍历)
    [LeetCode] 287. Find the Duplicate Number(寻找重复数字)
    [LeetCode] 215. Kth Largest Element in an Array(数组里的第 k 大元素)
    [LeetCode] 39. Combination Sum(组合的和)
    [LeetCode] 49. Group Anagrams(分组相同字母异序词)
    [LeetCode] 48. Rotate Image(旋转图片)
    [LeetCode] 647. Palindromic Substrings(回文子串)
    [LeetCode] 238. Product of Array Except Self(数组除自身元素外的乘积)
  • 原文地址:https://www.cnblogs.com/aomi/p/3085101.html
Copyright © 2011-2022 走看看