<?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] Expression builder complains on compilation problems I cant see in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Expression-builder-complains-on-compilation-problems-I/m-p/2213703#M10865</link>
    <description>Hi, tomersagi.. 
&lt;BR /&gt;the "Test" button in tMap Expression builder can only process actual data, not the TOS data flow from the tMap input.. 
&lt;BR /&gt;for example: 
&lt;BR /&gt; 
&lt;PRE&gt;StringHandling.LEN("hello world!")&lt;/PRE&gt; 
&lt;BR /&gt;pressing the test button will produce the result which is 
&lt;B&gt;12&lt;/B&gt;. 
&lt;BR /&gt;and.. 
&lt;BR /&gt; 
&lt;PRE&gt;Relational.ISNULL("")&lt;/PRE&gt; 
&lt;BR /&gt;pressing the test button will produce the result which is 
&lt;B&gt;false&lt;/B&gt;.. 
&lt;BR /&gt;hmm, i guess you need to ensure you use the correct syntax for null value as Relational.ISNULL(null) will return as true while Relational.ISNULL("") will return as false.. 
&lt;BR /&gt;so you can use something like this depending on the data: 
&lt;BR /&gt; 
&lt;PRE&gt;Relational.ISNULL(row1.yourField)?(0):(StringHandling.LEN(row1.yourField))&lt;/PRE&gt; 
&lt;BR /&gt;OR.. 
&lt;BR /&gt; 
&lt;PRE&gt;(StringHandling.TRIM(row1.yourField).equals(""))?(0):(StringHandling.LEN(row1.yourField))&lt;/PRE&gt; 
&lt;BR /&gt;just remember, Java is case sensitive.. there's a difference between null, "null", "", " ", "&amp;nbsp;&amp;nbsp; ", so on.. 
&lt;BR /&gt;hope that'll helps! 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;</description>
    <pubDate>Tue, 25 Nov 2014 14:20:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-11-25T14:20:15Z</dc:date>
    <item>
      <title>[resolved] Expression builder complains on compilation problems I cant see</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Expression-builder-complains-on-compilation-problems-I/m-p/2213702#M10864</link>
      <description>Hi,
&lt;BR /&gt;Newbie here. I'm using TOS for data integration, latest version.&amp;nbsp;
&lt;BR /&gt;I have a tMap after an SQL input operation. Trying to check if a field's value is null and if not get it's length.&amp;nbsp;
&lt;BR /&gt;
&lt;BR /&gt;I put some values in the test box and pressed &amp;lt;Test!&amp;gt; and I got the error message: "Exception in thread "main" java.lang.Error: Unresolved compilation problems: "
&lt;BR /&gt;But where can I see the compilation problems?
&lt;BR /&gt;When I hover over the red box in the Expression window I get a "Errors:6" message, but I don't know how to see these errors.&amp;nbsp;
&lt;BR /&gt;Please help!
&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 25 Nov 2014 13:09:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Expression-builder-complains-on-compilation-problems-I/m-p/2213702#M10864</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-25T13:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Expression builder complains on compilation problems I cant see</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Expression-builder-complains-on-compilation-problems-I/m-p/2213703#M10865</link>
      <description>Hi, tomersagi.. 
&lt;BR /&gt;the "Test" button in tMap Expression builder can only process actual data, not the TOS data flow from the tMap input.. 
&lt;BR /&gt;for example: 
&lt;BR /&gt; 
&lt;PRE&gt;StringHandling.LEN("hello world!")&lt;/PRE&gt; 
&lt;BR /&gt;pressing the test button will produce the result which is 
&lt;B&gt;12&lt;/B&gt;. 
&lt;BR /&gt;and.. 
&lt;BR /&gt; 
&lt;PRE&gt;Relational.ISNULL("")&lt;/PRE&gt; 
&lt;BR /&gt;pressing the test button will produce the result which is 
&lt;B&gt;false&lt;/B&gt;.. 
&lt;BR /&gt;hmm, i guess you need to ensure you use the correct syntax for null value as Relational.ISNULL(null) will return as true while Relational.ISNULL("") will return as false.. 
&lt;BR /&gt;so you can use something like this depending on the data: 
&lt;BR /&gt; 
&lt;PRE&gt;Relational.ISNULL(row1.yourField)?(0):(StringHandling.LEN(row1.yourField))&lt;/PRE&gt; 
&lt;BR /&gt;OR.. 
&lt;BR /&gt; 
&lt;PRE&gt;(StringHandling.TRIM(row1.yourField).equals(""))?(0):(StringHandling.LEN(row1.yourField))&lt;/PRE&gt; 
&lt;BR /&gt;just remember, Java is case sensitive.. there's a difference between null, "null", "", " ", "&amp;nbsp;&amp;nbsp; ", so on.. 
&lt;BR /&gt;hope that'll helps! 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Tue, 25 Nov 2014 14:20:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Expression-builder-complains-on-compilation-problems-I/m-p/2213703#M10865</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-25T14:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Expression builder complains on compilation problems I cant see</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Expression-builder-complains-on-compilation-problems-I/m-p/2213704#M10866</link>
      <description>Hi, 
&lt;BR /&gt;Thanks for the tips. It indeed helped with the test, but the component is still failing and for the life of me I can't understand how to debug it. When I run I get this output:&amp;nbsp; 
&lt;BR /&gt; 
&lt;PRE&gt;Exception in component tMap_1&lt;BR /&gt;java.lang.NullPointerException&lt;BR /&gt;	at yv_er.sql_to_blocking_0_1.SQL_To_Blocking.tMSSqlInput_3Process(SQL_To_Blocking.java:3927)&lt;BR /&gt;	at yv_er.sql_to_blocking_0_1.SQL_To_Blocking.tMSSqlInput_4Process(SQL_To_Blocking.java:5203)&lt;BR /&gt;	at yv_er.sql_to_blocking_0_1.SQL_To_Blocking.runJobInTOS(SQL_To_Blocking.java:6242)&lt;BR /&gt;	at yv_er.sql_to_blocking_0_1.SQL_To_Blocking.main(SQL_To_Blocking.java:6099)&lt;/PRE&gt; 
&lt;BR /&gt;I tried to Debug run in java debug mode but it wont stop on those lines eventhough I put a break point on both the component and the lines it the stack trace above.&amp;nbsp; 
&lt;BR /&gt;BTW, this is the relevant code: 
&lt;BR /&gt; 
&lt;PRE&gt;// ###############################&lt;BR /&gt;	{ // start of Var scope&lt;BR /&gt;		// ###############################&lt;BR /&gt;		// # Vars tables&lt;BR /&gt;		Var__tMap_1__Struct Var = Var__tMap_1;&lt;BR /&gt;		Var.DOBLen = Relational.ISNULL(row5.DOB) ? (0)&lt;BR /&gt;					: (StringHandling.LEN(row5.DOB));&lt;BR /&gt;		Var.tDate = Relational.ISNULL(row5.APPROX_DATEOFBIRTH) ? (null)&lt;BR /&gt;					: (TalendDate.parseDate("yyyy-MM-dd HH:mm:ss.0",&lt;BR /&gt;						row5.APPROX_DATEOFBIRTH));&lt;BR /&gt;		// ###############################&lt;BR /&gt;		// ###############################&lt;BR /&gt;		// # Output tables&lt;BR /&gt;		VRdobDay = null;&lt;BR /&gt;		// # Output table : 'VRdobDay'&lt;BR /&gt;		VRdobDay_tmp.Book_id = row5.Book_id;&lt;BR /&gt;		VRdobDay_tmp.dobDay = Var.DOBLen &amp;lt;= 4 ? null //this is line 3927&lt;BR /&gt;					: (Var.tDate == null ? (0) : &lt;BR /&gt;					TalendDate.getPartOfDate("DAY_OF_MONTH",&lt;BR /&gt;							Var.tDate));&lt;BR /&gt;		VRdobDay_tmp.dobMonth = Var.DOBLen &amp;lt;= 4 ? null&lt;BR /&gt;					: TalendDate.getPartOfDate("MONTH",&lt;BR /&gt;											Var.tDate);&lt;BR /&gt;		VRdobDay_tmp.dobYear = Var.DOBLen == 0 ? null&lt;BR /&gt;					: TalendDate.getPartOfDate("YEAR",&lt;BR /&gt;											Var.tDate);&lt;BR /&gt;		VRdobDay = VRdobDay_tmp;&lt;BR /&gt;		// ###############################&lt;BR /&gt;	} //&lt;BR /&gt;&lt;/PRE&gt; 
&lt;BR /&gt;line 3927 is marked with a comment.&amp;nbsp; 
&lt;BR /&gt;I probably did something stupid, but my main question is how do I debug this? 
&lt;BR /&gt;Thanks, 
&lt;BR /&gt;Tomer</description>
      <pubDate>Tue, 25 Nov 2014 15:07:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Expression-builder-complains-on-compilation-problems-I/m-p/2213704#M10866</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-25T15:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Expression builder complains on compilation problems I cant see</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Expression-builder-complains-on-compilation-problems-I/m-p/2213705#M10867</link>
      <description>hi,&lt;BR /&gt;Using Var &amp;amp; several ternary operator could become quicly hard to maintain.&lt;BR /&gt;Create a routine to do the job : &lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;just to get the idea ...&lt;BR /&gt;ex public static String manageNullDate(String DOB, Date APPROX_DATEOFBIRTH) {&lt;BR /&gt;         if(DOB == null){&lt;BR /&gt;            // put your default value&lt;BR /&gt;         }&lt;BR /&gt;         if(APPROX_DATEOFBIRTH == null){&lt;BR /&gt;            // your code&lt;BR /&gt;         }&lt;BR /&gt;         else { &lt;BR /&gt;         String partOf date  = TalendDate.parseDate("yyyy-MM-dd HH:mm:ss.0",APPROX_DATEOFBIRTH);&lt;BR /&gt;         etc ....&lt;BR /&gt;         }&lt;BR /&gt;  }&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;Clear to maintain and can reuse it if it's global enought&lt;BR /&gt;hope it helps&lt;BR /&gt;regards&lt;BR /&gt;laurent</description>
      <pubDate>Tue, 25 Nov 2014 16:34:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Expression-builder-complains-on-compilation-problems-I/m-p/2213705#M10867</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-25T16:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Expression builder complains on compilation problems I cant see</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Expression-builder-complains-on-compilation-problems-I/m-p/2213706#M10868</link>
      <description>Hi, Tomer..
&lt;BR /&gt;just like what laurent mentioned, i think the issue here is not within tMap but the data itself.. normally the "java.lang.NullPointerException" occurs when the data processed by the routine/function is not in the specified parameters..
&lt;BR /&gt;meaning, the data cannot be processed due to data quality issue..
&lt;BR /&gt;can you please run/debug run your job and point the output to tLogRow and see on which row of Book_id it stops?
&lt;BR /&gt;then please check the DOB and APPROX_DATEOFBIRTH field of that Book_id and see whether it has valid data that can be processed by your variables (Var.DOBLen &amp;amp; Var.tDate)
&lt;BR /&gt;i'm sure there's some data quality issue.. (like alphabets in DOB / APPROX_DATEOFBIRTH, eg: 0 (zero) and o (lowercase o) or O (upercase O) )..
&lt;BR /&gt;since you didn't specified what to do when there's alphabet in those fields..</description>
      <pubDate>Tue, 25 Nov 2014 17:07:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Expression-builder-complains-on-compilation-problems-I/m-p/2213706#M10868</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-25T17:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Expression builder complains on compilation problems I cant see</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Expression-builder-complains-on-compilation-problems-I/m-p/2213707#M10869</link>
      <description>Using routines is a great pointer.&amp;nbsp;&lt;BR /&gt;Thank you all,&lt;BR /&gt;Tomer</description>
      <pubDate>Wed, 26 Nov 2014 07:46:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Expression-builder-complains-on-compilation-problems-I/m-p/2213707#M10869</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-26T07:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Expression builder complains on compilation problems I cant see</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Expression-builder-complains-on-compilation-problems-I/m-p/2213708#M10870</link>
      <description>to complete sky_angel answer &amp;amp; data quality, Talend provide very useful tools thanks Data Profiler to discover what is exactly your data ans its quality :
&lt;BR /&gt;
&lt;A href="http://www.talend.com/resource/data-profiler.html" rel="nofollow noopener noreferrer"&gt;http://www.talend.com/resource/data-profiler.html&lt;/A&gt;
&lt;BR /&gt;regards
&lt;BR /&gt;laurent</description>
      <pubDate>Wed, 26 Nov 2014 10:35:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Expression-builder-complains-on-compilation-problems-I/m-p/2213708#M10870</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-26T10:35:20Z</dc:date>
    </item>
  </channel>
</rss>

