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)




  • 相关阅读:
    Python学习之路
    like's photos
    Django---子框架drf内容总结
    Django---子框架drf项目---路飞学城---前后端搭建
    Django---drf,JWT补充、基于就角色的权限控制(django内置auth体系)
    常见三种加密(MD5、非对称加密,对称加密)
    Django---drf,自定制频率、自动生成文档、JWT
    PEP8 常用规范
    Class meta
    Django---drf, books系列表接口、分页器、根据ip进行频率限制---作业
  • 原文地址:https://www.cnblogs.com/aomi/p/3085101.html
Copyright © 2011-2022 走看看