<?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: Bug in tSampleRow Range when using context variables in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Bug-in-tSampleRow-Range-when-using-context-variables/m-p/2346067#M113516</link>
    <description>Not really. This is due to the way TOS concatenates its part when generationg the Java code.&lt;BR /&gt;However don't forget to mark the solution as accepted.</description>
    <pubDate>Mon, 27 Nov 2017 14:16:22 GMT</pubDate>
    <dc:creator>TRF</dc:creator>
    <dc:date>2017-11-27T14:16:22Z</dc:date>
    <item>
      <title>Bug in tSampleRow Range when using context variables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Bug-in-tSampleRow-Range-when-using-context-variables/m-p/2346064#M113513</link>
      <description>&lt;P&gt;I am writing data into a DB2 database. Sadly this is slow because the ODBC driver.&lt;/P&gt; 
&lt;P&gt;For test purposes, I am sampling the data when the context "test" is used, else I take all of them.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;To show the issue, I created a minimal working example:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mwe-tsamplerow.png" style="width: 553px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lrmy.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134291i4C7BD21A731DA0BA/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lrmy.png" alt="0683p000009Lrmy.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;It works flawlessly, when the "Range" field in "tSampleRow_1" component is set to: "1,5,10..20" (the pre-filled example).&lt;/P&gt; 
&lt;P&gt;What I tried and is not working is the following: "1.." + context.db2_table_HCWH2H1P_sampleSize&lt;/P&gt; 
&lt;P&gt;In the "test" context, the context variable is set to 100, and in "production" to 99999999.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The job is not compiling. The source shows:&lt;/P&gt; 
&lt;PRE&gt;String[] rangetSampleRow_1 = "1.." + context.db2_table_HCWH2H1P_sampleSize.split(",");&lt;/PRE&gt; 
&lt;P&gt;with the error:&lt;/P&gt; 
&lt;PRE&gt;Type mismatch: Cannot convert from String to String[]&lt;/PRE&gt; 
&lt;P&gt;My guess is, that "Talend Open Studio for Big Data" is taking the value in the "Range" field, and puts a '.split(",")' at the end.&lt;/P&gt; 
&lt;P&gt;What happens is, that the context variable gets split rather than the whole string. It ends up with a "String" and this mismatches the "String[]" variable type of "rangetSampleRow_1".&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;An easy solution is, to put some brackets around the "Range" field, and append the '.split(",")' after the closing bracket.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;For my case, I worked around the problem by putting the whole string "1..100" into the context variable, rather than only the upper bound "100".&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Additional information:&lt;/P&gt; 
&lt;P&gt;- Product: Talend Open Studio for Big Data&lt;/P&gt; 
&lt;P&gt;- Version: 6.4.1&lt;/P&gt; 
&lt;P&gt;- OS: Win10&lt;/P&gt; 
&lt;P&gt;- Java: JDK 1.8&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 09:00:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Bug-in-tSampleRow-Range-when-using-context-variables/m-p/2346064#M113513</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T09:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in tSampleRow Range when using context variables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Bug-in-tSampleRow-Range-when-using-context-variables/m-p/2346065#M113514</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Use this syntax:&lt;/P&gt;&lt;PRE&gt;("1.." + context.db2_table_HCWH2H1P_sampleSize)&lt;/PRE&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 14:05:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Bug-in-tSampleRow-Range-when-using-context-variables/m-p/2346065#M113514</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-11-27T14:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in tSampleRow Range when using context variables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Bug-in-tSampleRow-Range-when-using-context-variables/m-p/2346066#M113515</link>
      <description>&lt;P&gt;This works fine. But I still think that it is a bug in Talend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 14:10:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Bug-in-tSampleRow-Range-when-using-context-variables/m-p/2346066#M113515</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-27T14:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in tSampleRow Range when using context variables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Bug-in-tSampleRow-Range-when-using-context-variables/m-p/2346067#M113516</link>
      <description>Not really. This is due to the way TOS concatenates its part when generationg the Java code.&lt;BR /&gt;However don't forget to mark the solution as accepted.</description>
      <pubDate>Mon, 27 Nov 2017 14:16:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Bug-in-tSampleRow-Range-when-using-context-variables/m-p/2346067#M113516</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-11-27T14:16:22Z</dc:date>
    </item>
  </channel>
</rss>

