Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{scrollbar}

h1. ?????? "??????????, ???\!"

???????? ?? ???????? ??????? ???????, ? ??? ???????????? ???????? ???????? ?????? ? PDI:
* ?????? ? ??????????????? Spoon
* ??????????????
* ???? ? ????????
* ???????????????? ??????????
* ??????????????? ???????? ? ?????????? ?? Spoon
* ?????????? ?????????????? ?? ???? ????????? ?????????? Pan.

h2. ????????

??? ?????? ?????????????? ??? ?????????? ?????? ??????? ? ???? ????? ? ??????? CSV ?????, ? ?????????? ??????? XML ???? ? ???????????? ??? ??????? ?? ???.

???? ?????????? CVS ????? ??? ????????? ?????:
{code}
???????,???
??????,????
????????,??????
???????,????
????????,?????
???????,???????
???????,????
{code}
?? ??????? XML ???? ????? ????????? ????? ????:
{code}
<Rows>
 ?<Row>
       <message>??????????, ????!</message>
  </Row>
 ?<Row>
       <message>??????????, ??????!</message>
  </Row>
 ?<Row>
       <message>??????????, ????!</message>
  </Row>
 ?<Row>
       <message>??????????, ?????!</message>
  </Row>
 ?<Row>
       <message>??????????, ???????!</message>
  </Row>
 ?<Row>
       <message>??????????, ????!</message>
  </Row>
</Rows>
{code}
????? ?????????? ??????? ?????????????? ????? ???????? ???? ??????????? ?? ?????.

? ????? ????? ?????????????? ??????? ?? ??????? ????? (Step) ????????? ?????????? (Hop). ?????? ???? ? ???????? ?????????? ???? ??????????? ??????? ??????. ?? ???? ???????, ??? ?????????????? _?????????????? ?? ????? ??????_.

h2. ?????????? ?????????

?? ??????? ?????????????? ?????????? ??????? ????? *Tutorial* ? ???????? ??????????? ??? ????? ?????? ?????. ? ??? ????? ???????? ??? ????? ?? ??????? ???????. ????? ????????? CSV ???? ? ??????????? ???? ???????????, ? ????????? ? ????? *Tutorial* ??? ?????? *list.csv*.

h2. ?????????? ?? ??????????????

???????????? ?????? ????? ????????? ?? ??? ?????:
# ???????? ??????????????
# ?????????? ??????? ?????????????? ?? ????????? ????? ? ?????????
# ????????? ????? ? ???????????? ? ???????????? ?? ??? ????????

h3. ???????? ??????????????

# ?????? *New*, ????? ??????? *Transformation*, ??? ? ???? *File* ? ??????? *New*, ? ????? *Transformation*. ????? ???????? ?????????? ?????? *Ctrl-N*.
# ?????? *Transformation*, ?????? *Settings...*.
# ??????????? ???? ????????? ?????? ????????? ??? ??????????????. ?? ??? ??????? ??????? ?????????? ?????? ???? ????? ???????? ?????????????? (Transformation name) ? ???????? (Description), ????? ?????? *Save*.
# ????????? ?????????????? ? ???????? *Tutorial* ??? ?????? *hello*. ??? ???????? ??????? ???? *hello.ktr*.

h3. ?????????? ??????? ?????????????? ?? ????????? ????? ? ?????????

?? ????????? ????????? _?????_ ??????? ?????? ??????????????. ?? ????? ???????????? ????? ? ?????? ??????? ???????????? ????????? ?????????? ?? ???? (Input) ? ????? (Output) ?????? ??/??? ??????? ??????????/??????????. ?????? ?? ????? ?????????? ???, ????? ??? ?????????? ???????????? ????????? ??? ???????????? ???????, ???????? ??? ?????? ???????????? ?????????? ??? ???????????? ?????? ????????? ??????.

_???????_ ??? ??????????? ????????????? ???????? ?????? ????? ????? ?????? ?? ????????? ? ?????????. ?????? ???????????? ?? ????????? ???????? ????????? ?? ???? ????????? ?????? (Output Data) ? ????????????? ??? ????????? ?? ???? ???????? ?????? (Input Data). ? ?????? ???????? ???? ?????? ???? ?????? ? ???? ?????????, ?? ????? ??????? ????????? ????????? ??????? ????? ???????? ?? ?????? ????. ??? ????? ??????? ????????? ?????? ????? ???? ??????????? ??? ???????????? ????? ?????? ?? ??????????. ??????????, ?????? ??? ???? ??? ????? ????????? ????????????? ????. ? ????? ??????? ??? ?????? ???????? ???????????? ?????????? ???????? ?????? ?? ?????????? ??????????, ????? ??????? ?????? ????? ????????? ??????.

?????????????? ?????? ????????? ????????? ???????:
* ???????? ?????? ?? ????? ??????? CSV
* ???????????? ???????????
* ????????? ??????????? ? ????? ??????? XML

??? ??????? ?? ???? ??????? ?????????? ???????????? ????????? ????, ???????? ?????????????? ???? ?????:

!PDI-Hello-World-3-1.png!

? ?????? ??????? ???????? ????? ???????? ? ?????? ?????????? ??? ???? ? ??????, ??? ??????????? ?????????????? ????? ???????, ?? ??? ?????? ?? ??????.

??? ???? ????? ?????? ????????? ?????????????? ??????????:
# ? ???? ?????????? Spoon ??????????? ?????? *Steps Palette*, ? ??? ???????? ????????? *Input*.
# ?????????? ?????? *CSV file* ? ??????? ??????? ??????.
# ???????? ????????? *Scripting*.
# ?????????? ?????? *Modified JavaScript Value* ? ??????? ???????.
# ???????? ????????? *Output*.
# ?????????? ?????? *XML Output* ? ??????? ???????.

?????? ?????????? ???????????? ????? ????? *CSV file input* ? *Modified Java Script Value* ?????? ???????:
# ??????? ?????? ??????? ????.
# ????????? ?? ?????????? *Shift* ??????????? ?????? ?? ?????? ??????? ????.
# ?????????? ????? ????? *Modified Java Script Value* ? *XML Output* ???????? ????????.

!PDI-Hello-World-3-2.png!

h3. ????????? ????? ? ???????????? ? ???????????? ?? ??? ????????

??? ??????? ?? ????? ????????????? ???? ??????????????? ????????. ? ?????? ???? ??????????????? ????????? ???????????? ?????????????? ??????????? ??????? ???? ????? ? ????????? ? ??????? ??? ?????????. ??? ???? ???????????? ???? (Step Name) ?????????? ??? ??????????? ? ??????????????, ?? ????? ?? ?????????????? ??????????? ????. ???????? ???? (Step Description) ???????? ????????? ???? ?????????? ????, ? ????? ?? ?????? ?? ?????????????? ???????????.

h4. ????????? ???? ???? ?? CSV ????? (CSV file input)

# ?????? ?????? ?? ??? *CSV file input*.
# ????????? ???? ???????? ??? ????? ????. ? ??? ?????????? ??????? ????????????, ?????? ? ? ??????? ?????????? ????? ??? ????????.
# ???????? ???????????? ???????? ??-????????? ? ????? *Step name* ?? ????? ??????????????? ??????????? ?? ?????? ??? ???????. ??? ??????? ??????? ??????? ??? *????????? ?????? ????*.
# ? ????? *Filename* ?????? ???????? ? ???????????? ????????? ?????.
{quote}
*{_}??????????:_* ?????? ?? ???? ????? ????????? ?????? ? ???? ???????? ???????. ??? ?????????? ??????????? ????????????? ? ?????? ???? ??????????, ????? ??? ??????????? ????? ? ?????? ????. ?????????? ????? ???? ??????? ??????? $\{name_of_the_variable\} ??? ??????? ?? ?????? ? ???? ??????????, ??? ???? ??????? ???????????? ?????? *Ctrl-??????*. ? ?????? ???? ???????????? ???????????????? ?????????? ? ?????????? ???????? ?????????????, ?? ??? ??? ?????????? ?? ??????????, ?? ? ?????? ????? ???? ???????????????? ??????????. ????? ??? ?????????? ???????:
{code}
${Internal.Transformation.Filename.Directory}
{code}
????? ?????????? ????????? ????????? ????? ? ??? ????? ?????????? ??????????????:
{code}
${Internal.Transformation.Filename.Directory}/list.csv
{code}
????? ??????? ???????? ?????? ?????????? ????? ???????? ? ???????? ? ???? ???? ? ???????? ??? ???? ????????? ??????????????. ????? ?????????????? ????? ?????? ???? *list.csv* ? ?????? ????????.
{quote}
# ??????? ?????? *Get Fields* ????????? ?????? ???????????? ???????? ? ????????? ?????? ?? ????????? ?????. ?????????????? ??? ? ????? ???? ????????? (??? ????? ? ????? *Header row present* ?????? ?????? ???????).
{quote}
*{_}??????????:_* ?????? *Get Fields* ?????????? ?? ?????? ????? ????? ? ???????? ? ???? ????????. ??? ?????????? ??? ???????? ????????? ?????? ?? ??????? ?????????? ??? ?? ?????????? ?????. ??? ???? ??? ??? ????? ????????? ???????, ?? ??? ?????? ????????? ????? ??????????? ??? ????????? ????????? ????? ? ??? ???? ?????????????? ????????????? ?? ????.
{quote}
# ?????? ????????? ???????? ???????????? ???????? ?? ?????. ??? ??????? ??????? ??? *???????* ? *???*:
!PDI-Hello-World-3-3.png|thumbnail!
# ????? ??????? ? ????? *Lazy conversion?*.
{quote}
*{_}??????????:_* ??? ?????? ? ??????? ??????????? ????? ????????? ????? ????? ????? ????????? ????????? ?????? ????? ???? ?????? ?? ?????? ? ????? *File encoding* ??????????????? ????????.
{quote}
# ?????? *Preview* ? ??????????????, ??? ???? ????? ????????? ????????. ?????????? ?? ????? ?????? ?????? ??????????? ? ??????????? ????.
# ?????? *OK* ??? ?????????? ? ???????? ???????? ??? ???? *CSV file input*.

h4. ???????????? ???? JavaScript ??? ??????????? ???????? (Modified JavaScript Value)

# ?????? ?????? ?? ??? *Modified JavaScript Value*.
# ????????? ???? ???????? ??? ????? ????. ?????? ???? ?????????? ?? ??????????? ???????????? ????????? ???????????? ???? ?? ????? JavaScript. ??? ?????????? ??? ???????? ????? ?? ???? ??????, ????????? ??????????? *"??????????, "* ? ?????? ?? ????.
# ??????? ?????? ??? *???????? ???????????*.
# ??????????? ??????? ???? ???????? ????????????? ??? ????? ????. ? ????? ?????? ??????????? ????? ????????? ??? ????????????? ??? ????????? ???? ???????. ??? ???? ????? ?????? ???????????? ??? ?????? *Input fields* ? *Output fields* ??????? ? ?????????????. ??? ??????? ??????? ??????????? ??? ????: *???????* ? *???*. ?????? ????????? ???:
{code}
var message = '??????????, ' + ???.getString() + "!";
{code}
{quote}
*{_}??????????:_* ??????? *???.getString()* ????? ?????? ??????? ??? ?????? ?????? ?? ?????? ???? ? ?????????????? ?????? ???????.
{quote}
# ? ?????? ????? ???? ?????????? ?????? ??????????? ? ?????????? ?????????? ??????? ??????????. ? ?????? ??????? ??????? ?????????? *message*. ??? ??? ???????? ?????? ?????????? ?????? ???? ???????? ? ???? ? ??????????? ??????????????, ???????????? ?????? ?????????? ??????? ??????? ? ??????. ????????? ????? ????? ????????? ???:
!PDI-Hello-World-3-4.png|thumbnail!
{quote}
(!) *{_}????????:_* ?? ??????? ?????? ?????????? ?????? ??????? ? ??????????? ?????????? PDI, ??? ?? ???? ? ????.
{quote}
{quote}
*{_}??????????:_* ??? ????????????? ????????? ???????? ? ????????? ????????? ?????? PDI ??????? ????? *Compatibility mode?* ???????? ????????.
{quote}
# ?????? *OK* ??? ?????????? ? ???????? ???????? ??? ???? *Step Modified Script Value*.
# ??????? ?????? ?????? ??? ?????????????????? ????. ?? ?????? ???? ?????????? ?????????? ?????? ???? ? _???????? ????? (Input Field)_ ? ???????? ?? ???? ?????? ? _????????? ????? (Output Field)_. _???????? ????_ ????????? ?? ?????? ????. _????????? ????_ ???????? ?????? ???. ?????? ??? ?????????? ????????????? ???????? ??????????? ??????. ?? ? ?????? ???????, ???????? ??????????? ?????? ?? ???????? ??? ????????? ?????????? ?????? ???? ????????? ????. ?? ???? ????, ??????? ????????? ???????? ? ???????? ?????, ???????? *Calculator*. ????? ???? ???? ???????????? ?????????? ? ?????????????? ??????????? ??????, ? ?????????? _????????? ????_ ?????? _???????? ?????_, ???????? *Group by*.
# ?????? ?????? ??????? ???? ??? ??????? ? ???????????? ????.
# ??????? *Show Input Fields*. ? ??????????? ???? ????? ??????? ???????? ???? *???????* ? *???*, ?????????? ?? ?????????? ????.
# ??????? *Show Output Fields*. ? ??????????? ???? ?????, ??? ? ??????????? ???? ???????? ??? ?????????, ?? ?????????? ???? ????? ???? *message*.

h4. ???????????? ???? ????? ? XML ???? (XML Output)

# ?????? ?????? ?? ??? *XML Output*. ????????? ???? ??? ??????? ???? ????. ?? ?????? ???? ???????????? ????? ???????????? ? ???????? ????? ? ??????????? ?????????? ??????????????. ????? ???????? ????, ??????? ?????????? ????????? ? ?????? ????. ??? ?????? ????? ???? ????????, ??? ??? ???? ????????? ??????? ????, ??? ? ????????? ???? ?? ??????.
# ?? ??????? *File* ?????? ???????? *???????? ?????? ???????????* ??? ??????? ????.
# ? ????? *File* ??????:
{code}
${Internal.Transformation.Filename.Directory}/hello.xml
{code}
# ??????? ?? ??????? *Fields* ? ?????? ?????? *Get Fields*, ? ?????? ????? ???????? ??? ???? ??? ??????. ??? ?????????? ????? ?????????? ?????? ???? *message*, ??????? ?????????? ??????? ???? *???* ? *???????*.
!PDI-Hello-World-3-5.png|thumbnail!   !PDI-Hello-World-3-6.png|thumbnail!
# ?????? *OK* ??? ?????????? ? ???????? ???????? ??? ???? *XML Output*.
# ????????? ??????????????.

h2. ???????? ??????

??? ?????????? ?????????????? ??????????? ??? ???? ??????????? ????????????.  ??-?? ????, ??? ?????????????? ????????? ?????? ??????????, ???????? ?????????? ????????? ????? ???????????. ?????? ??????????? ?????? ?????? ?????????? ?? ????????? ???? ?? ?????? ????????? ?????? ??????. ?????????? ?? ???????? ??? ??????????? ??????????????, ??? ??? ??? ????? ?????? ?????? ?? ?????????? ??????????.

????????? ??????? "??????, ???!" ??????????? ?????????. ?????????????? ????????? ?????? ?? ???????? ?????, ? ??????? ???? JavaScript ????????? ??????????? ??? ??????? ?? ????? ??????, ? ? ????? ?????????? ????????? ???????????? ? ???????? ????. ? ?????? ????????? ??????? ????? ????????? ????? ? ???????, ??????? ???????? ??????????? ?????????? ????? ??????. ?????? ???? ????? ????? ???, ????? ???? ??? ???????????? ? ???????? ????, ?????? ???????? ?????? ??? ??????????????.

h2. ????????, ???????? ? ??????????

# ????? ??????????? ??????????????, ?????????? ????????? ???????????? ????????????, ??????? *Transformation* ? ?????? *Verify*. Spoon ???????? ????????? ??????????????, ?????? ???????????? ???? ? ?????????????? ?????. ???? ?????????????? ?????? ???????? ??????? (? ??? ?????? ???? ?????? ???, ???? ????????? ?????? ??????????), ??? ?????? ??? ??? ???????????????? ?????????.
# ???????? ??? *???????? ???????????*, ??????? *Transformation* ? ????? ?????? *Preview*. ?????? ???????? ???? ????:
!PDI-Hello-World-3-7.png|thumbnail!
# ??? ????? ?????? Spoon ?????????? ?????????????? ??????????? ?????????? ?????????? ?????????? ????. ?????? ?????? *QuickLaunch*. ????? ???? ???????? ???? ? ??????????????? ??????????? ????????? ? ?????????? ?????????? ???? *???????? ???????????*. ???? ????????? ????????????? ????????????? ???????????, ?????? ??? ????? ??? ?????????? ??????????????.
# ??????? *Transformation* ? ????? ?????? *Run*.
# ???????? ???? ? ??????? ????? ?????? ????????? ?????????? ? ???????????? ??????????????. ?????? ?????? *Launch*.
# ? ?????? ????? ???? ?????????? ???????? ???? ? ??????????? ?????????. ?? ???????? ?????????? ?????????? ? ?????????? ???????? ??????????????.

?? ??????? *Step Metrics* ?????????? ?????????? ???????? ?????????????? ?? ?????. ?????????? ???????? ???????? ?? ????????? ???????:
* *Read*: ?????????? ????? ?????????? ? ?????????? ?????.
* *Written*: ?????????? ????? ?????????? ? ??????? ???? ?? ?????????.
* *Input*: ????? ????? ??????????? ?? ????? ??? ??????? ???? ??????.
* *Output*: ????? ????? ?????????? ? ???? ??? ??????? ???? ??????.
* *Errors*: ????? ?????? ????????? ??? ??????????. ???? ???????? ?????? ?????? ?????????? ???????.

?? ??????? *Logging* ????????? ?????? ??????????. ? ??? ?????????? ????????? ?????????? ? ?????????? ?????????????? ?? ?????. ???? ???????? ????????? ?????? ??????????, ?? ????? ??????? ????????????? ?????????? ?????. ??? ???????? ?????????? ?????????????? ? ?????? ?????? ??????? ????? ????????? ?????????:
{code}
Spoon - The transformation has finished!!
{code}
????? ??? ???????? ?????????? ?????????????? ????? ?????? ???? *hello.xml*, ?????????? ????????? ??? ?????????? ?? ???????????? ?????????? ???????????? ??????.

h2. Pan

Pan ??? ?????? ?????????? ?????????????? ?? ????????????? ????. ??? ?????? ???????????? ????? ?????? *pan.bat* ? Windows ??? *pan.sh* ?? ?????? ??????????, ??? ??????????? ? ???????????? ????????. ???? ?????? ??????????? ??? ?????????? ?? ????? ????????? ?????? ????????? ?????????? ??? ?????????? Pan.

????????? ?????????????? ????? ????????? ????????:
{code}
Pan /file <Jobs_path>/hello.ktr /norep
{code}
* */norep* ??????? ?? ???????? ??????????? Spoon ? ???????????.
* */file* ????????? ?? ??? ????? ??????????? ??????????????.
* *<Jobs_path>* ?????? ???? ? ???????? ? ????????:

{code}
C:/Pentaho/Tutorial
{code}
???
{code}
/home/PentahoUser/Tutorial
{code}
????????? ????????? ??????? ????? ???????????? ??-?????????.

????? ??????? ?????? ???????  ?????????????? ????? ????????? ????? ?????, ??? ? ??? ??????? ????? Spoon. ? ?????? ?????? ????? ????? ??????? ?? ????? ??? ? ???? (???? ??? ???????) ?????? ??????????. ?????? ??????? ????? ?????????? ?? ????, ??? ??? ??????????? ? ??????????? ????????, ??? ???? ?????????? ?????????? ????? ???????????.

{scrollbar}