One Star

tSchemaComplianceCheck errorCode Not expected behaviour

Hi,
I have a simple job with :
tFileInputDelimited -->tSchemaComplianceCheck --reject--> tFileOutputDelimited
In the description of tSchemaComplianceCheck with can read that errCode is a summation of ALL errorcode :
2 for type disparency
4 for null or empty
8 for length and precision error
Now if i analyse my outputfile :
The two first lines, there is no problem. They match the rules above.
Errcode -- ErrMsg
8 -- MEINS:exceed max length
4 -- MEINS:empty or null
But when i got multiple error it start to have a weird behaviour :
Errcode -- ErrMsg
16 -- MATKL:empty or null;MEINS:empty or null
10 -- NTGEW:wrong type|invalid Length setting is unsuitable for Precision
8 -- VOLUMSmiley Tonguerecision Non-matches
8 -- VOLUM:invalid Length setting is unsuitable for Precision
16 -- NTGEW:wrong type|invalid Length setting is unsuitable for Precision;VOLUM:invalid Length setting is unsuitable for Precision
The first line is already mind blowing since empty or null throw a 4 errorcode so it should be 8 (4+4). Since 16 is 4*4 at this point i was thinking that errorcode from different column was multiply.
The next line is ok, wrong type (2) + invalid length(8) give 10.
Two next lines are ok too for obvious reason.
But the last one is really annoying. The result is 16. There is 3 errors, wrong type and invalid length should give 10 like my previous line showed it, so with an other invalid precision it should end to 18 and if i apply my consideration about multiple column multiplying errocode is should be 10 * 8 = 80.
Finally i have two big problems : Two errors of 4 value gives 16, and a triple errors that should leads to 18 gives 16.
Do i am wrong somewhere ?
3 REPLIES
Moderator

Re: tSchemaComplianceCheck errorCode Not expected behaviour

Hi,
How did you set tSchemaComplianceCheck? Have you already check component reference TalendHelpCenter:tSchemaComplianceCheck?
Could you please elaborate your case with an example with input and expected output values?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: tSchemaComplianceCheck errorCode Not expected behaviour

I am using a schema for compliance check and treat empty as NULL.
Schema is kind of :
MATKL Not Nullable String Length 9
MEINS Not Nullable String Length 3
NTGEW Nullable BigDecimal Length 13(decimal 3)
VOLUM Nullable BigDecimal Length 13(decimal 3)
Input
line number | MATKL | MEINS | NTGEW | VOLUM
1 | TEST | TESTLENGTH| |
2 | TEST | | |
3 | | | 12 | 12
4 | TEST | TES | num12345678901 | |
5 | TEST | TES | | 123.1234 |
6 | TEST | TES | | 12345678901234 |
7 | TEST | TES | num12345678901 | 12345678901234 |
Following cimponent rules :
2 for type disparency
4 for null or empty
8 for length and precision error
my expected result is :
line number | error message | error code
1 | MEINS : max length | 8
2 | MEINS : null | 4
3 | MATKL : null ;MEINS : null | 8(4+4)
4 | NTGEW : wrong type + max length | 10 (2+8)
5 | VOLUM : max precision | 8
6 | VOLUM max length | 8
7 | NTGEW : wrong type + max length ; VOLUM max length | 18 ( 2+ 8 + 8)
Actual result :
line number | error message | error code
1 | MEINS:exceed max length | 8
2 | MEINS:empty or null | 4
3 | MATKL:empty or null;MEINS:empty or null | 16
4 | NTGEW:wrong type|invalid Length setting is unsuitable for Precision | 10
5 | VOLUMSmiley Tonguerecision Non-matches | 8
6 | VOLUM:invalid Length setting is unsuitable for Precision | 8
7 | NTGEW:wrong type|invalid Length setting is unsuitable for Precision;VOLUM:invalid Length setting is unsuitable for Precision | 16
So error message are perfects but error code are not the expected one taking in consideration the rules described by the component itself.
Community Manager

Re: tSchemaComplianceCheck errorCode Not expected behaviour

Hi BREUILj
It looks like there is a bug, i tested it with v5.4.1 and got the same problem. Can you please report jira issue under Talend DI project in our bugtracker.
https://jira.talendforge.org/secure/Dashboard.jspa
Thanks!
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business