Kettle javascript step error handling, kettlejavascript
Javascript Step Error Handling
If you are familiar with the incorrect features of kettle conversion, you may want to know how to use it in javascript steps. The steps and user interfaces that support the error mechanism are the same. Right-click the javascript step and select "define error handling" to enable and configure error handling. Javascript code can identify error lines and forward them to the configured error handling steps. The following parameters are required by using the putError () method of the _ step _ OBJECT:
1) RowMetaInterface Object Description row Structure
2) current error line
3) number of errors detected in this row
4) Error description string (error message)
5) name of the field that caused the error (string)
6) error code (string)
Normally, original, unmodified input rows are passed to the error handling step. Therefore, the first two parameters are usually specified as getInputRowMeta () andRow. Other parameters depend on how you describe the errors you encounter. The javascript step defines the error handling configuration. You can configure the fields to be output to the error handling step.
The conversion example first generates a random string. For the purpose of illustration, the javascript step determines that the letters 'A' and 'K' are missing from the preceding characters, and an error is returned when each letter is missing.
The javascript step contains the following code:
varshould_error_on_a= (value.indexOf("a") == -1)?1:0;varshould_error_on_k= (value.indexOf("k") == -1)?1:0; try{ if(should_error_on_a== 1 && should_error_on_k == 1){ throw{ message:"Value must contain 'a' and 'k'", nr_errors:2, field:"value", errcode:"ERR:003" } } elseif(should_error_on_a== 1){ throw{ message:"Value must contain 'a'", nr_errors:1, field:"value", errcode:"ERR:001" } } elseif(should_error_on_k== 1){ throw{ message:"Value must contain 'k'", nr_errors:1, field:"value", errcode:"ERR:002" } } //continue normally, passing the row on to the next step trans_Status= CONTINUE_TRANSFORMATION; }catch(e){ //divert the current row to the error step and do not pass anything to thenext step _step_.putError(getInputRowMeta(),row, e.nr_errors, e.message, e.field, e.errcode); trans_Status= SKIP_TRANSFORMATION;}
Kettle 42 database connection error, help,
It should be a problem with Mysql database configuration. there are corresponding liberation methods on the Internet, such:
Solution:
1. Change the table. It may be that your account is not allowed to log on remotely, but only on localhost. At this time, you only need to log in to mysql on the computer of localhost, and change the "host" entry in the "user" table in the "mysql" database to "%" from "localhost"
Mysql-u root-pvmwaremysql> use mysql; mysql> update user set host = '%' where user = 'root'; mysql> select host, user from user;
2. Authorization method. For example, if you want myuser to use mypassword to connect to the mysql server from any host.
This is not a Kettle issue.
When kettle is connected to SQL Server, an error is reported that the instance yss_pc does not exist, but the instance yss_pc exists when SQL Server Management Studio is started.
The error indicates that an error is reported when you connect to the database ~
Link driver exception ~
You 'd better check your connection statement first, check your connection port and the like, and check if there is a problem with the data driver.