Uruchamianie transformacji Spoon w Pan
Pan jest programem uruchamianym z poziomu linii komend, który pozwala na uruchamianie transformacji stworzonych przy pomocy Kettle Spoon. Transformacje te mogą być uruchamiane z pliku XML (mających rozszerzenie ktr – skrót od kettle transformation) lub tez bezposrednio z repozytorium zapisanego w bazie danych.
Uruchomienie skryptu zapisanego w pliku pan.bat (pan.sh dla Linux/Unix) bez żadnych parametrów spowoduje wyświetlenie wszystkich dostępnych opcji. W naszym tutorialu pokażemy jak uruchamiać transformacje na oba sposoby - z pliku XML i z poziomu repozytorium.
- Uruchomienie transformacji z pliku XML (ktr) jest mało skomplikowane i polecenie wygląda następująco:
pan.bat /file:"D:\DW\pentaho\trsfCountry.ktr" /level:Basic - Aby uruchomić transformację z repozytorium, należy umieścić w poleceniu szczegóły połączenia z repozytorium wraz z loginem i hasłem.
Transformacja zaprojektowana w przykładzie Spoon z poprzedniej lekcji możne uruchomić w Pan w następujący sposób:
pan.bat /rep:"DWDEV" /trans:"trsfCountry" /dir:/ /user:admin /pass:admin /level:Minimal
Poniżej umieszczony został log wykonania joba (poziom logowania ustawiony na Basic):
10:36:28,582 INFO [Pan] Pan - Logging is at level : Basic 10:36:28,582 INFO [Pan] Pan - Start of run. 10:36:29,751 INFO [trsfCountry] trsfCountry - Dispatching started for transformation [trsfCountry] 10:36:29,751 INFO [trsfCountry] trsfCountry - Nr of arguments detected:0 10:36:29,751 INFO [trsfCountry] trsfCountry - This is not a replay transformation 10:36:29,844 INFO [trsfCountry] trsfCountry - This transformation can be replayed with replay date: 2007/06/05 10:36:29 10:36:29,844 INFO [trsfCountry] trsfCountry - Initialising 4 steps... 10:36:29,860 INFO [0] Countries starting with S.0 - Opening output stream in default encoding 10:36:29,860 INFO [0] Rejects.0 - Opening output stream in default encoding 10:36:30,140 INFO [0] Countries starting with S.0 - Starting to run... 10:36:30,140 INFO [0] Rejects.0 - Starting to run... 10:36:30,140 INFO [0] Filter rows.0 - Starting to run... 10:36:30,140 INFO [0] Table input.0 - Starting to run... 10:36:30,327 INFO [0] Table input.0 - Finished reading query, closing connection. 10:36:30,327 INFO [0] Filter rows.0 - Finished processing (I=0, O=0, R=249, W=249, U=0, E=0) 10:36:30,327 INFO [0] Rejects.0 - Finished processing (I=0, O=219, R=218, W=0, U=0, E=0) 10:36:30,327 INFO [0] Table input.0 - Finished processing (I=249, O=0, R=0, W=249, U=0, E=0) 10:36:30,343 INFO [0] Countries starting with S.0 - Finished processing (I=0, O=32, R=31, W=0, U=0, E=0) 10:36:30,405 INFO [trsfCountry] trsfCountry - Transformation ended. 10:36:30,405 INFO [Pan] Pan - Finished! 10:36:30,405 INFO [Pan] Pan - Start=2007/06/05 10:36:29.345, Stop=2007/06/05 10:36:30.405 10:36:30,405 INFO [Pan] Pan - Processing ended after 1 seconds. 10:36:30,405 INFO [trsfCountry] trsfCountry - 10:36:30,405 INFO [trsfCountry] trsfCountry - Process Filter rows'. 0 ended successfully, processed 249 lines. ( 249 lines/s) 10:36:30,405 INFO [trsfCountry] trsfCountry - Process Countries starting with S'. 0 ended successfully, processed 31 lines. ( 31 lines/s) 10:36:30,405 INFO [trsfCountry] trsfCountry - Process Table input'. 0 ended successfully, processed 0 lines. ( 0 lines/s) 10:36:30,405 INFO [trsfCountry] trsfCountry - Process Rejects'. 0 ended successfully, processed 218 lines. ( 218 lines/s)
Szkolenia, usługi konsultingowe i wdrożenia systemów Business Intelligence, hurtowni danych, raportowania i implementacja procesów ETL.
www.goliinfo.com