<?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 App generating Databricks Direct Query SQL with unquoted selection value in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/App-generating-Databricks-Direct-Query-SQL-with-unquoted/m-p/2491220#M102066</link>
    <description>&lt;P&gt;I have configured a Qlik Cloud application to query a Databricks cloud database using "Direct Query" and a custom SQL statement.&amp;nbsp; I've simplified my application down to a single SQL statement and a single table. When the app loads, it uses my SQL statement to fetch the first batch of data, and it is successfully displayed in the table.&amp;nbsp; When I make a selection on the table, the application generates the SQL to filter the table using the selection.&amp;nbsp; Unfortunately, the SQL is not being generated properly and I get an error dialog.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tgrant_0-1730927458385.png" style="width: 200px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/173927iDF80E451FC3C2861/image-size/small?v=v2&amp;amp;px=200" role="button" title="tgrant_0-1730927458385.png" alt="tgrant_0-1730927458385.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;EM&gt;Direct Query mode error: SQL Adaptor error: Connector error: ERROR [42703] [Qlik][Hardy] (80) &lt;BR /&gt;Syntax or semantic analysis error thrown in server while executing query. &lt;BR /&gt;Error message from server: org.apache.hive.service.cli.HiveSQLException: Error running query:&lt;BR /&gt; [UNRESOLVED_COLUMN.WITH_SUGGESTION] org.apache.spark.sql.catalyst.ExtendedAnalysisException:&lt;BR /&gt; [UNRESOLVED_COLUMN.WITH_SUGGESTION] A column, variable, or function parameter with name `DDG70`.&lt;/EM&gt;&lt;/PRE&gt;
&lt;P&gt;In Databricks, I can see the SQL that was generated and submitted.&amp;nbsp; The SQL includes a WHERE clause with "&lt;STRONG&gt;IN (DDG70)&lt;/STRONG&gt;" that &lt;U&gt;should be&lt;/U&gt; "&lt;STRONG&gt;IN ('DDG70')&lt;/STRONG&gt;".&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tgrant_1-1730928272036.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/173929i240B44761A0912C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tgrant_1-1730928272036.png" alt="tgrant_1-1730928272036.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I've simplified the App to just the custom SQL and table to show the issue.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tgrant_2-1730928609691.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/173930iC10907F00B2FDC70/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tgrant_2-1730928609691.png" alt="tgrant_2-1730928609691.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Is there a work around or fix for this?&amp;nbsp; For the complicated case, I need to use custom SQL.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Nov 2024 18:11:09 GMT</pubDate>
    <dc:creator>tgrant</dc:creator>
    <dc:date>2024-11-07T18:11:09Z</dc:date>
    <item>
      <title>App generating Databricks Direct Query SQL with unquoted selection value</title>
      <link>https://community.qlik.com/t5/App-Development/App-generating-Databricks-Direct-Query-SQL-with-unquoted/m-p/2491220#M102066</link>
      <description>&lt;P&gt;I have configured a Qlik Cloud application to query a Databricks cloud database using "Direct Query" and a custom SQL statement.&amp;nbsp; I've simplified my application down to a single SQL statement and a single table. When the app loads, it uses my SQL statement to fetch the first batch of data, and it is successfully displayed in the table.&amp;nbsp; When I make a selection on the table, the application generates the SQL to filter the table using the selection.&amp;nbsp; Unfortunately, the SQL is not being generated properly and I get an error dialog.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tgrant_0-1730927458385.png" style="width: 200px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/173927iDF80E451FC3C2861/image-size/small?v=v2&amp;amp;px=200" role="button" title="tgrant_0-1730927458385.png" alt="tgrant_0-1730927458385.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;EM&gt;Direct Query mode error: SQL Adaptor error: Connector error: ERROR [42703] [Qlik][Hardy] (80) &lt;BR /&gt;Syntax or semantic analysis error thrown in server while executing query. &lt;BR /&gt;Error message from server: org.apache.hive.service.cli.HiveSQLException: Error running query:&lt;BR /&gt; [UNRESOLVED_COLUMN.WITH_SUGGESTION] org.apache.spark.sql.catalyst.ExtendedAnalysisException:&lt;BR /&gt; [UNRESOLVED_COLUMN.WITH_SUGGESTION] A column, variable, or function parameter with name `DDG70`.&lt;/EM&gt;&lt;/PRE&gt;
&lt;P&gt;In Databricks, I can see the SQL that was generated and submitted.&amp;nbsp; The SQL includes a WHERE clause with "&lt;STRONG&gt;IN (DDG70)&lt;/STRONG&gt;" that &lt;U&gt;should be&lt;/U&gt; "&lt;STRONG&gt;IN ('DDG70')&lt;/STRONG&gt;".&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tgrant_1-1730928272036.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/173929i240B44761A0912C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tgrant_1-1730928272036.png" alt="tgrant_1-1730928272036.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I've simplified the App to just the custom SQL and table to show the issue.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tgrant_2-1730928609691.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/173930iC10907F00B2FDC70/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tgrant_2-1730928609691.png" alt="tgrant_2-1730928609691.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Is there a work around or fix for this?&amp;nbsp; For the complicated case, I need to use custom SQL.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 18:11:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/App-generating-Databricks-Direct-Query-SQL-with-unquoted/m-p/2491220#M102066</guid>
      <dc:creator>tgrant</dc:creator>
      <dc:date>2024-11-07T18:11:09Z</dc:date>
    </item>
  </channel>
</rss>

