<?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: Using QlikSense variable in Spark SQL query (Simba connector) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-QlikSense-variable-in-Spark-SQL-query-Simba-connector/m-p/1376173#M613561</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First try without WHERE condition then see.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Nov 2017 09:12:52 GMT</pubDate>
    <dc:creator>Anil_Babu_Samineni</dc:creator>
    <dc:date>2017-11-13T09:12:52Z</dc:date>
    <item>
      <title>Using QlikSense variable in Spark SQL query (Simba connector)</title>
      <link>https://community.qlik.com/t5/QlikView/Using-QlikSense-variable-in-Spark-SQL-query-Simba-connector/m-p/1376172#M613560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello folks,&lt;/P&gt;&lt;P&gt;Need help with using a qliksense variable in Spark SQL query.&lt;/P&gt;&lt;P&gt;I have made connection using Simba Spark and its working fine. But could not figure out what i am doing wrong here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, here i want to fetch data for all the bucket_id in Data table. I can use loop and fetch one by one or i can pass a list using where in statement since spark is querying cassandra and i have constraints with queries. Given query below, would be great if someone can help me with this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD bucket_id&lt;/P&gt;&lt;P&gt;resident OD&lt;SPAN style="font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LIB CONNECT TO 'Simba Spark (qlik-sense_administrator)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let noRows = NoOfRows('Data')-1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i=0 to $(noRows)&lt;/P&gt;&lt;P&gt;let vVar=FieldValue('bucket_id',$(i));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;X&gt;:&lt;/X&gt;&lt;/P&gt;&lt;P&gt;LOAD *, $(vVar);&lt;/P&gt;&lt;P&gt;SQL SELECT bucket_id&lt;/P&gt;&lt;P&gt;FROM SPARK.database1.x&lt;/P&gt;&lt;P&gt;where bucket_id='$(vVar)';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; next i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; Here, in given above code, i am getting error as :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The following error occurred:&lt;/P&gt;&lt;P class="edc_error" style="padding: 0 10px; background: rgba(255, 38, 38, 0.2); color: #595959; font-family: 'Courier New'; font-size: 15px;"&gt;SQL##f - SqlState: S1000, ErrorCode: 35, ErrorMsg: [Simba][Hardy] (35) Error from server: error code: '0' error message: 'org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 764.0 failed 4 times, most recent failure: Lost task 0.3 in stage 764.0 (TID 94867, ip-172-31-30-155.ap-southeast-1.compute.internal): java.io.IOException: Exception during execution of SELECT "bucket_id" FROM "database1"."x" WHERE "bucket_id" = ? ALLOW FILTERING: Key may not be empty at com.datastax.spark.connector.rdd.Cas&lt;/P&gt;&lt;P class="headline edc_error" style="padding: 0 10px; background: rgba(255, 38, 38, 0.2); font-weight: bolder; color: #595959; font-family: 'Courier New'; font-size: 15px;"&gt;The error occurred here:&lt;/P&gt;&lt;P class="edc_error" style="padding: 0 10px; background: rgba(255, 38, 38, 0.2); color: #595959; font-family: 'Courier New'; font-size: 15px;"&gt;SQL SELECT bucket_id FROM SPARK.database1.x where bucket_id=''&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Nov 2017 07:28:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-QlikSense-variable-in-Spark-SQL-query-Simba-connector/m-p/1376172#M613560</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-13T07:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using QlikSense variable in Spark SQL query (Simba connector)</title>
      <link>https://community.qlik.com/t5/QlikView/Using-QlikSense-variable-in-Spark-SQL-query-Simba-connector/m-p/1376173#M613561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First try without WHERE condition then see.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Nov 2017 09:12:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-QlikSense-variable-in-Spark-SQL-query-Simba-connector/m-p/1376173#M613561</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-11-13T09:12:52Z</dc:date>
    </item>
  </channel>
</rss>

