Wednesday, December 30, 2015

kettle - Filter step not working initialize both input steps

2015/12/30 17:57:54 - Get Variables.0 - Finished processing (I=0, O=0, R=1, W=1, U=0, E=0)
2015/12/30 17:57:54 - Table input.0 - Finished reading query, closing connection.
2015/12/30 17:57:54 - Table input 2.0 - ERROR (version 5.4.0.1-130, build 1 from 2015-06-14_12-34-55 by buildguy) : Unexpected error
2015/12/30 17:57:54 - Table input 2.0 - ERROR (version 5.4.0.1-130, build 1 from 2015-06-14_12-34-55 by buildguy) : org.pentaho.di.core.exception.KettleDatabaseException: 
2015/12/30 17:57:54 - Table input 2.0 - An error occurred executing SQL: 
2015/12/30 17:57:54 - Table input 2.0 - SELECT **********************
2015/12/30 17:57:54 - Table input 2.0 - Invalid object name ''.
2015/12/30 17:57:54 - Table input 2.0 - 
2015/12/30 17:57:54 - Table input 2.0 - at org.pentaho.di.core.database.Database.openQuery(Database.java:1722)
2015/12/30 17:57:54 - Table input 2.0 - at org.pentaho.di.trans.steps.tableinput.TableInput.doQuery(TableInput.java:224)
2015/12/30 17:57:54 - Table input 2.0 - at org.pentaho.di.trans.steps.tableinput.TableInput.processRow(TableInput.java:138)
2015/12/30 17:57:54 - Table input 2.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2015/12/30 17:57:54 - Table input 2.0 - at java.lang.Thread.run(Thread.java:745)
2015/12/30 17:57:54 - Table input 2.0 - Caused by: java.sql.SQLException: Invalid object name '******'.
2015/12/30 17:57:54 - Table input 2.0 - at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
2015/12/30 17:57:54 - Table input 2.0 - at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820)
2015/12/30 17:57:54 - Table input 2.0 - at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258)
2015/12/30 17:57:54 - Table input 2.0 - at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:632)
2015/12/30 17:57:54 - Table input 2.0 - at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:477)
2015/12/30 17:57:54 - Table input 2.0 - at net.sourceforge.jtds.jdbc.JtdsStatement.executeQuery(JtdsStatement.java:1304)
2015/12/30 17:57:54 - Table input 2.0 - at org.pentaho.di.core.database.Database.openQuery(Database.java:1711)
2015/12/30 17:57:54 - Table input 2.0 - ... 4 more
2015/12/30 17:57:54 - mock_transformation - ERROR (version 5.4.0.1-130, build 1 from 2015-06-14_12-34-55 by buildguy) : Errors detected!
2015/12/30 17:57:54 - Table input.0 - Finished processing (I=7, O=0, R=0, W=7, U=0, E=0)
2015/12/30 17:57:54 - Table input 2.0 - Finished reading query, closing connection.
2015/12/30 17:57:54 - Filter rows 2.0 - Finished processing (I=0, O=0, R=1, W=0, U=0, E=0)
2015/12/30 17:57:54 - Table input 2.0 - Finished processing (I=0, O=0, R=0, W=0, U=0, E=1)
2015/12/30 17:57:54 - mock_transformation - Transformation detected one or more steps with errors.
2015/12/30 17:57:54 - mock_transformation - Transformation is killing the other steps!





Problem
(can say property of kettle)
All the process in pentaho kettle initialized in parallel. If you are having steps (Table input, table output, etc) in your transformation. When you execute the ktr, all of these steps are initialized all together.

"Execute SQL Script" step in Pentaho Kettle is self triggering. It gets executed at the initialization phase of the transformation.

Solution
Use job level steps for data filtration and sql execution

for me its works around
filter rows - "Simple Evaluation"

table_input - "Evaluate rows number in a table"


Monday, December 28, 2015

Caused by: java.sql.SQLRecoverableException: No more data to read from socket at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1200)

Caused by: java.sql.SQLRecoverableException: No more data to read from socket at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1200)

C:\ProgramData\Oracle\Java\javapath;
E:\app\gursingh\product\11.2.0\dbhome_1\bin;
C:\Program Files (x86)\Intel\iCLS Client\;
C:\Program Files\Intel\iCLS Client\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;
C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;
C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;
C:\Program Files\Java\jdk1.7.0_65\bin\;C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin;
C:\Program Files\TortoiseGit\bin;C:\Program Files (x86)\Skype\Phone\;
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;E:\a_installation\SQLServer\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;
E:\a_installation\SQLServer\110\Tools\Binn\ManagementStudio\;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\;E:\a_installation\SQLServer\110\DTS\Binn\


I faced this error while using kettle while transformation execution
Steps in transformation

1. Table Input (Get date (data_type - DATE) from some table, this date will pass in next "table input")
2. Table Input (Simple select query with where clause "where coalesce(Created_date,modified_date) > coalesce(to_date(?,'any format'),to_date('any default date','any date format')" )

Above error populate at second step while conversion of date type string,
I have googled it, as a solution i found it is a driver issue, but for me its not a driver issue, it is data-type conversion error.

Solution:
As a solution i have added one more step in transformation:

1. Table Input (Get date (data_type - DATE) from some table, this date will pass in next "table input")
2. "Select values" [in "metadata" tab - change datatype of date to "STRING"]
3. Table Input (Simple select query with where clause "where coalesce(Created_date,modifieddate) > coalesce(to_date(?,'any format'),to_date('any default date','any date format')" )

Wednesday, December 2, 2015

ORA-01704: string literal too long

create table test (sno number , textstring clob );

insert into test values(1,'PASTE YOUR STRING HERE');

insert into test values(1,'
                          *
ERROR at line 1:
ORA-01704: string literal too long


Problem
The string you are trying to insert is more than of 4000 char. As SQL datatype Char,Varchar, nvarchar and clob have limit of 4000 chars where as on other hand PLSQL have char limit of 32000

Solution
Use PLSQL to insert long length string


DECLARE
    v_string CLOB;
BEGIN
    v_string := 'PASTE YOUR STRING HERE';

    INSERT INTO test 
VALUES (1, v_string);
END; 
/
PL/SQL procedure successfully completed.

web stats