<?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: DatabaseError: (databricks.sql.exc.ServerOperationError) [UNBOUND_SQL_PARAMETER] in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/databaseerror-databricks-sql-exc-serveroperationerror-unbound/m-p/56444#M2151</link>
    <description>&lt;P&gt;&lt;SPAN&gt;This is not databricks issue but from langchain. A PR has been raised to solve this:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;SPAN&gt;One workaround that worked is:&amp;nbsp;&lt;A href="https://github.com/langchain-ai/langchain/issues/11068" target="_blank" rel="noopener"&gt;https://github.com/langchain-ai/langchain/issues/11068&lt;/A&gt; setting&amp;nbsp;&lt;/SPAN&gt;sample_rows_in_table_info&lt;SPAN&gt;&amp;nbsp;to 0 when calling&amp;nbsp;&lt;/SPAN&gt;SQLDatabase.from_databricks()&amp;nbsp;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jan 2024 18:34:11 GMT</pubDate>
    <dc:creator>nag_kanchan</dc:creator>
    <dc:date>2024-01-04T18:34:11Z</dc:date>
    <item>
      <title>DatabaseError: (databricks.sql.exc.ServerOperationError) [UNBOUND_SQL_PARAMETER]</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databaseerror-databricks-sql-exc-serveroperationerror-unbound/m-p/54993#M1951</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to connect my database through LLM and expecting to receive a description of the table and 1st 3 rows from the table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from langchain.agents import create_sql_agent
from langchain.agents.agent_toolkits import SQLDatabaseToolkit
from langchain.sql_database import SQLDatabase
from langchain import OpenAI
from langchain.agents.agent_types import AgentType

db = SQLDatabase.from_databricks(catalog="hive_metastore", schema="my_data", host="*****.gcp.databricks.com",api_token="dapi*****")
llm = OpenAI(temperature=0.9)
toolkit = SQLDatabaseToolkit(db=db, llm=llm)
agent = create_sql_agent(llm=llm, toolkit=toolkit, verbose=True)

agent.run("describe silver_tableabc")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error that I am facing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DatabaseError: (databricks.sql.exc.ServerOperationError) [UNBOUND_SQL_PARAMETER] Found the unbound parameter: param_1. Please, fix `args` and provide a mapping of the parameter to either a SQL literal or collection constructor functions such as `map()`, `array()`, `struct()`. SQLSTATE: 42P02; line 3 pos 7
[SQL: SELECT silver_tableabc.health,silver_tableabc.cust_id,... FROM silver_tableabc
 LIMIT :param_1]
[parameters: {'param_1': 3}]
(Background on this error at: https://sqlalche.me/e/20/4xp6)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Version:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Cluster: 14.2ML ( even tried with general purpose 14.2, 13.3)&lt;/LI&gt;&lt;LI&gt;Langchain: 0.0.348 (even tried with 0.0.341)&lt;/LI&gt;&lt;LI&gt;SQLAlchemy: 2&lt;SPAN&gt;.0&lt;/SPAN&gt;&lt;SPAN&gt;.12&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;databricks&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;connector:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;3.0&lt;/SPAN&gt;&lt;SPAN&gt;.0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/9"&gt;@Retired_mod&lt;/a&gt;&amp;nbsp;COuld you please help me how can I resolve this?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Dec 2023 11:59:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databaseerror-databricks-sql-exc-serveroperationerror-unbound/m-p/54993#M1951</guid>
      <dc:creator>nag_kanchan</dc:creator>
      <dc:date>2023-12-10T11:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: DatabaseError: (databricks.sql.exc.ServerOperationError) [UNBOUND_SQL_PARAMETER]</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databaseerror-databricks-sql-exc-serveroperationerror-unbound/m-p/54995#M1952</link>
      <description>&lt;P&gt;I am getting the same error when executing this notebook:&amp;nbsp;&lt;A href="https://docs.databricks.com/en/_extras/notebooks/source/machine-learning/large-language-models/sql-database-agent-langchain.html" target="_blank"&gt;https://docs.databricks.com/en/_extras/notebooks/source/machine-learning/large-language-models/sql-database-agent-langchain.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Dec 2023 13:12:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databaseerror-databricks-sql-exc-serveroperationerror-unbound/m-p/54995#M1952</guid>
      <dc:creator>nag_kanchan</dc:creator>
      <dc:date>2023-12-10T13:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: DatabaseError: (databricks.sql.exc.ServerOperationError) [UNBOUND_SQL_PARAMETER]</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databaseerror-databricks-sql-exc-serveroperationerror-unbound/m-p/55901#M2080</link>
      <description>&lt;P&gt;Hi team,&lt;/P&gt;&lt;P&gt;We tried similar the approach as above with following versions of compatability DBR 14.2&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;langchain&lt;/SPAN&gt;&lt;SPAN&gt;==&lt;/SPAN&gt;&lt;SPAN&gt;0.0&lt;/SPAN&gt;&lt;SPAN&gt;.348 databricks&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;vectorsearch&lt;/SPAN&gt;&lt;SPAN&gt;==&lt;/SPAN&gt;&lt;SPAN&gt;0.22&lt;/SPAN&gt;&lt;SPAN&gt; openai&lt;/SPAN&gt;&lt;SPAN&gt;==&lt;/SPAN&gt;&lt;SPAN&gt;0.27&lt;/SPAN&gt;&lt;SPAN&gt; langchain&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;experimental databricks&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;connector&lt;/SPAN&gt;&lt;SPAN&gt;==&lt;/SPAN&gt;&lt;SPAN&gt;3.0&lt;/SPAN&gt;&lt;SPAN&gt;.0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;In the run method there is no way to pass any positional parameters like {'param_1':3}.&lt;/DIV&gt;&lt;DIV&gt;Can you please help us how can i modify my below statement using&amp;nbsp;&lt;SPAN&gt;set:param_1 to 3 statement to make it work?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;agent.&lt;/SPAN&gt;&lt;SPAN&gt;run&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"what the job title of contact kevin young"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Murali&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2023 17:45:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databaseerror-databricks-sql-exc-serveroperationerror-unbound/m-p/55901#M2080</guid>
      <dc:creator>MuraliPinninti_</dc:creator>
      <dc:date>2023-12-28T17:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: DatabaseError: (databricks.sql.exc.ServerOperationError) [UNBOUND_SQL_PARAMETER]</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databaseerror-databricks-sql-exc-serveroperationerror-unbound/m-p/55924#M2082</link>
      <description>&lt;P&gt;It worked after downgrading &lt;STRONG&gt;databricks-sql-connector to 2.9.3.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;For the same question format:&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;agent.&lt;/SPAN&gt;&lt;SPAN&gt;run&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"what the job title of contact kevin young"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Murali&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2023 13:28:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databaseerror-databricks-sql-exc-serveroperationerror-unbound/m-p/55924#M2082</guid>
      <dc:creator>MuraliPinninti_</dc:creator>
      <dc:date>2023-12-29T13:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: DatabaseError: (databricks.sql.exc.ServerOperationError) [UNBOUND_SQL_PARAMETER]</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databaseerror-databricks-sql-exc-serveroperationerror-unbound/m-p/56444#M2151</link>
      <description>&lt;P&gt;&lt;SPAN&gt;This is not databricks issue but from langchain. A PR has been raised to solve this:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;SPAN&gt;One workaround that worked is:&amp;nbsp;&lt;A href="https://github.com/langchain-ai/langchain/issues/11068" target="_blank" rel="noopener"&gt;https://github.com/langchain-ai/langchain/issues/11068&lt;/A&gt; setting&amp;nbsp;&lt;/SPAN&gt;sample_rows_in_table_info&lt;SPAN&gt;&amp;nbsp;to 0 when calling&amp;nbsp;&lt;/SPAN&gt;SQLDatabase.from_databricks()&amp;nbsp;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 18:34:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databaseerror-databricks-sql-exc-serveroperationerror-unbound/m-p/56444#M2151</guid>
      <dc:creator>nag_kanchan</dc:creator>
      <dc:date>2024-01-04T18:34:11Z</dc:date>
    </item>
  </channel>
</rss>

