<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [resolved] tFileInputPositional &amp;gt; tJavaRow check if row has error and map message in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-tFileInputPositional-gt-tJavaRow-check-if-row-has-error/m-p/2266709#M45834</link>
    <description>Actually you have already provided a solution for that here:&amp;nbsp; 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCqe8CAC" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/resolved-Get-input-file-row-by-row-as-a-string/td-p/110268&lt;/A&gt; 
&lt;BR /&gt;Thanks again, 
&lt;BR /&gt;Scott</description>
    <pubDate>Wed, 14 Oct 2015 04:49:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-10-14T04:49:58Z</dc:date>
    <item>
      <title>[resolved] tFileInputPositional &gt; tJavaRow check if row has error and map message</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tFileInputPositional-gt-tJavaRow-check-if-row-has-error/m-p/2266701#M45826</link>
      <description>Hi there,
&lt;BR /&gt;I have a tFileInputPositional with a schema set that defines string, date and integer columns. &amp;nbsp;I am reading this into a tJavaRow.
&lt;BR /&gt;In the tJavaRow I want to check if there is an error for this row. &amp;nbsp;Eg; for an integer when I supply the value "12a" from the source file for a test, I see in the log the following message for that row:
&lt;BR /&gt;
&lt;I&gt;For input string: "12a"&lt;/I&gt;
&lt;BR /&gt;As a side note it would be magnificent if the above error message actually said something like the following as this is a message you could send back to the user:
&lt;BR /&gt;
&lt;I&gt;Invalid Integer in column: "Col1" with value: "12a"&lt;/I&gt;&amp;nbsp;on line# 3
&lt;BR /&gt;Having said that, the output schema of tJavaRow has a couple of additinal columns from the input. &amp;nbsp;These columns are RawText and ErrorMessage.
&lt;BR /&gt;What I need to be able to to is:
&lt;BR /&gt;&amp;nbsp;- For every row I need to write the entire line value into the RawText field of that row.
&lt;BR /&gt;&amp;nbsp;- For every row check to see if there was an error reading in the current row and if there was an error, then create an error message like the one above that quotes column name, value, and line#, and write the error message to the ErrorMessage field of that row.
&lt;BR /&gt;What is the best way to do this?
&lt;BR /&gt;Thank you for your time,
&lt;BR /&gt;Scott</description>
      <pubDate>Sat, 16 Nov 2024 10:59:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tFileInputPositional-gt-tJavaRow-check-if-row-has-error/m-p/2266701#M45826</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T10:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tFileInputPositional &gt; tJavaRow check if row has error and map message</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tFileInputPositional-gt-tJavaRow-check-if-row-has-error/m-p/2266702#M45827</link>
      <description>Hi Scott 
&lt;BR /&gt;Actually, this error is thrown on tFileInputPositional component, if you check the 'die on error' box, the component will the throw out the Java exception and display the error message.&amp;nbsp; 
&lt;BR /&gt;You can read all columns with string type, and then link tFileInputPositional to a tSchemaComplianceCheck, and use a custom schema to check the data, if the data does not match the schema, it will be rejected with external columns including &amp;nbsp;error code and error message.&amp;nbsp; 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Tue, 13 Oct 2015 02:20:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tFileInputPositional-gt-tJavaRow-check-if-row-has-error/m-p/2266702#M45827</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-13T02:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tFileInputPositional &gt; tJavaRow check if row has error and map message</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tFileInputPositional-gt-tJavaRow-check-if-row-has-error/m-p/2266703#M45828</link>
      <description>Shong, 
&lt;BR /&gt;Thanks for the response mate. &amp;nbsp;Ok so I created a test file as follows: 
&lt;BR /&gt; 
&lt;PRE&gt;001Name Value here120151013Description Value Here1789190&lt;BR /&gt;002Name Value here220151035Description Value Here2789190&lt;BR /&gt;03aName Value here320151013Description Value Here3789190&lt;/PRE&gt; 
&lt;BR /&gt;So this screen shot demonstrates how the columns are defined: 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBu2.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140962i28EE9F4DEF386160/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBu2.png" alt="0683p000009MBu2.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;For testing purposes line 2 has an invalid date in Col3, and line 3 has an invalid integer in Col1 
&lt;BR /&gt;The tFileInputPositional is configured as follows: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBlH.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/155631iB04D14218F34E898/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBlH.png" alt="0683p000009MBlH.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBu7.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157176i59C93E388A5F7057/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBu7.png" alt="0683p000009MBu7.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;The tSchemaComplianceCheck is configured as follows: 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBuC.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144951iFDF59B834543C304/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBuC.png" alt="0683p000009MBuC.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBuH.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/139722i5D6360966A87AAF3/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBuH.png" alt="0683p000009MBuH.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;But it shows this warning: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBuM.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/155669i673D572D31EDA174/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBuM.png" alt="0683p000009MBuM.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;And when I run the job I get the following error: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBuR.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141234i294523DDFAE89557/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBuR.png" alt="0683p000009MBuR.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt; 
&lt;PRE&gt;Starting job TestValidationForPositionalFileImport at 09:35 14/10/2015.&lt;BR /&gt; connecting to socket on port 3711&lt;BR /&gt; connected&lt;BR /&gt;Exception in thread "main" java.lang.Error: Unresolved compilation problems: &lt;BR /&gt;	Type mismatch: cannot convert from String to Integer&lt;BR /&gt;	Type mismatch: cannot convert from String to Date&lt;BR /&gt;	Type mismatch: cannot convert from String to Integer&lt;BR /&gt;	at test.testvalidationforpositionalfileimport_0_1.TestValidationForPositionalFileImport.tFileInputPositional_1Process(TestValidationForPositionalFileImport.java:1238)&lt;BR /&gt;Job TestValidationForPositionalFileImport ended at 09:35 14/10/2015. &lt;BR /&gt;&lt;/PRE&gt; 
&lt;BR /&gt;There is a tLogRow component connected via row/main to the tSchemaComplianceCheck and it has the same schema as the output schema of the tSchemaComplianceCheck&amp;nbsp; 
&lt;BR /&gt;What have I done wrong here? 
&lt;BR /&gt;Thanks for your time, 
&lt;BR /&gt;Scott</description>
      <pubDate>Tue, 13 Oct 2015 23:37:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tFileInputPositional-gt-tJavaRow-check-if-row-has-error/m-p/2266703#M45828</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-13T23:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tFileInputPositional &gt; tJavaRow check if row has error and map message</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tFileInputPositional-gt-tJavaRow-check-if-row-has-error/m-p/2266704#M45829</link>
      <description>It is a compliance error in the generated code of job, because the output schema is different from input schema. The schema of tSchemaComplianceCheck should be same as the schema of tFileInputPositional, but check the 'custom defined' box and define custom schema to check the input data.&amp;nbsp;</description>
      <pubDate>Wed, 14 Oct 2015 02:15:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tFileInputPositional-gt-tJavaRow-check-if-row-has-error/m-p/2266704#M45829</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-14T02:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tFileInputPositional &gt; tJavaRow check if row has error and map message</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tFileInputPositional-gt-tJavaRow-check-if-row-has-error/m-p/2266705#M45830</link>
      <description>Shong, 
&lt;BR /&gt;Thanks for the reply mate. &amp;nbsp;So I did a Sync Columns on the tSchemaComplanceCheck component and now it runs without error. 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBuW.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/151530i5FA84DBC2801BB81/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBuW.png" alt="0683p000009MBuW.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;And the output of the job is: 
&lt;BR /&gt; 
&lt;PRE&gt;Starting job TestValidationForPositionalFileImport at 12:54 14/10/2015.&lt;BR /&gt; connecting to socket on port 3500&lt;BR /&gt; connected&lt;BR /&gt;001|Name Value here1|20151013|Description Value Here1|789190&lt;BR /&gt; disconnected&lt;BR /&gt;Job TestValidationForPositionalFileImport ended at 12:54 14/10/2015. &lt;/PRE&gt; 
&lt;BR /&gt;Which is correct it has only loaded the one line that was without error. &amp;nbsp;But how do I get the error messages for the other lines? 
&lt;BR /&gt;Basically for every line that has an error I need to get the error for that line and put it in a field in an output schema of a tJavaRow that I would connect to the tSchemaComplianceCheck component. 
&lt;BR /&gt;I also need to get the entire line of the file being read as a string and assign that to a field in the output of the tJavaRow. 
&lt;BR /&gt;How can I do this mate. 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;Scott</description>
      <pubDate>Wed, 14 Oct 2015 03:01:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tFileInputPositional-gt-tJavaRow-check-if-row-has-error/m-p/2266705#M45830</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-14T03:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tFileInputPositional &gt; tJavaRow check if row has error and map message</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tFileInputPositional-gt-tJavaRow-check-if-row-has-error/m-p/2266706#M45831</link>
      <description>The problematic lines are rejected and put them in the reject flow, right click on tSchemaComplianceCheck and select 'main--&amp;gt;reject' and link it to a output component such as tLogRow.</description>
      <pubDate>Wed, 14 Oct 2015 03:37:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tFileInputPositional-gt-tJavaRow-check-if-row-has-error/m-p/2266706#M45831</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-14T03:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tFileInputPositional &gt; tJavaRow check if row has error and map message</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tFileInputPositional-gt-tJavaRow-check-if-row-has-error/m-p/2266707#M45832</link>
      <description>Shong, 
&lt;BR /&gt;That's is perfect mate! Thanks for your efforts &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; 
&lt;BR /&gt;Is there a definition of the error codes somewhere? 
&lt;BR /&gt; 
&lt;PRE&gt;Starting job TestValidationForPositionalFileImport at 14:35 14/10/2015.&lt;BR /&gt; connecting to socket on port 3416&lt;BR /&gt; connected&lt;BR /&gt;.----+----------------+--------+-----------------------+------.&lt;BR /&gt;|                          tLogRow_2                          |&lt;BR /&gt;|=---+----------------+--------+-----------------------+-----=|&lt;BR /&gt;|Col1|Col2            |Col3    |Col4                   |Col5  |&lt;BR /&gt;|=---+----------------+--------+-----------------------+-----=|&lt;BR /&gt;|001 |Name Value here1|20151013|Description Value Here1|789190|&lt;BR /&gt;'----+----------------+--------+-----------------------+------'&lt;BR /&gt;.----+----------------+--------+-----------------------+------+---------+------------------------------------------.&lt;BR /&gt;|                                                    tLogRow_3                                                     |&lt;BR /&gt;|=---+----------------+--------+-----------------------+------+---------+-----------------------------------------=|&lt;BR /&gt;|Col1|Col2            |Col3    |Col4                   |Col5  |errorCode|errorMessage                              |&lt;BR /&gt;|=---+----------------+--------+-----------------------+------+---------+-----------------------------------------=|&lt;BR /&gt;|002 |Name Value here2|20151035|Description Value Here2|789190|2        |Col3:wrong DATE pattern or wrong DATE data|&lt;BR /&gt;|03a |Name Value here3|20151013|Description Value Here3|789190|2        |Col1:wrong type                           |&lt;BR /&gt;'----+----------------+--------+-----------------------+------+---------+------------------------------------------'&lt;BR /&gt; disconnected&lt;BR /&gt;Job TestValidationForPositionalFileImport ended at 14:35 14/10/2015. &lt;/PRE&gt; 
&lt;BR /&gt;Thanks for your time, 
&lt;BR /&gt;Scott</description>
      <pubDate>Wed, 14 Oct 2015 04:40:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tFileInputPositional-gt-tJavaRow-check-if-row-has-error/m-p/2266707#M45832</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-14T04:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tFileInputPositional &gt; tJavaRow check if row has error and map message</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tFileInputPositional-gt-tJavaRow-check-if-row-has-error/m-p/2266708#M45833</link>
      <description>Oh actually one more thing... how do I get the complete line of text for each line in the file. &amp;nbsp;In the output schema of tJavaRows that I will connect to the row main and row reject there is a field called RawText where I have to put the raw text from each line in the corresponding row in the database table. &amp;nbsp;We are staging data from these import text files in the database so I need to import the data into fields, record an error for each line if there is one, (which we have sorted now), record the raw text from each line in a field of the import row. 
&lt;BR /&gt;How can I do this? 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;Scott</description>
      <pubDate>Wed, 14 Oct 2015 04:46:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tFileInputPositional-gt-tJavaRow-check-if-row-has-error/m-p/2266708#M45833</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-14T04:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tFileInputPositional &gt; tJavaRow check if row has error and map message</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tFileInputPositional-gt-tJavaRow-check-if-row-has-error/m-p/2266709#M45834</link>
      <description>Actually you have already provided a solution for that here:&amp;nbsp; 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCqe8CAC" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/resolved-Get-input-file-row-by-row-as-a-string/td-p/110268&lt;/A&gt; 
&lt;BR /&gt;Thanks again, 
&lt;BR /&gt;Scott</description>
      <pubDate>Wed, 14 Oct 2015 04:49:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tFileInputPositional-gt-tJavaRow-check-if-row-has-error/m-p/2266709#M45834</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-14T04:49:58Z</dc:date>
    </item>
  </channel>
</rss>

