<?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: Error in Data Engineering 2.2 notebook when executing SQL statement in Training offerings</title>
    <link>https://community.databricks.com/t5/training-offerings/error-in-data-engineering-2-2-notebook-when-executing-sql/m-p/60110#M377</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/85039"&gt;@leandrob13&lt;/a&gt;&amp;nbsp; I have found a post that helped me with this &lt;A href="https://stackoverflow.com/questions/77278763/read-sqlite-db-file-in-databricks-using-pyspark-facing-path-not-exists-error-in" target="_self"&gt;link&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It seems that the Databricks community edition has some limitations&lt;/P&gt;&lt;P&gt;"T&lt;SPAN&gt;he community edition doesn't support DBFS fuse, so you can't use&amp;nbsp;&lt;/SPAN&gt;/dbfs&lt;SPAN&gt;&amp;nbsp;file path. To access your sqlite database you need to copy file to the local disk using dbutils and then access it from there using the local file path:&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;/dfs dbutils.fs.cp("dbfs:/mnt/dbacademy-users/my-user/data-engineer-learning-path/ecommerce.db", "file:/tmp/ecommerce.db")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;And then modify the load of data&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;DROP TABLE IF EXISTS users_jdbc;

CREATE TABLE users_jdbc
USING JDBC
OPTIONS (
  url = "jdbc:sqlite:/tmp/ecommerce.db",
  dbtable = "users"
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Feb 2024 01:56:36 GMT</pubDate>
    <dc:creator>jonathanchcc</dc:creator>
    <dc:date>2024-02-14T01:56:36Z</dc:date>
    <item>
      <title>Error in Data Engineering 2.2 notebook when executing SQL statement</title>
      <link>https://community.databricks.com/t5/training-offerings/error-in-data-engineering-2-2-notebook-when-executing-sql/m-p/37992#M74</link>
      <description>&lt;P&gt;This notebook is plagued with errors. After solving the one&amp;nbsp;&lt;A href="https://community.databricks.com/t5/data-engineering/problems-with-pandas-read-parquet-and-path/td-p/19655/page/2" target="_self"&gt;described here&lt;/A&gt;&amp;nbsp;I ran into another one when trying to execute the SQL statement in the "Extracting Data from SQL Databases" section:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DROP TABLE IF EXISTS users_jdbc;

CREATE TABLE users_jdbc
USING JDBC
OPTIONS (
  url = "jdbc:sqlite:${DA.paths.ecommerce_db}",
  dbtable = "users"
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Error in SQL statement: SQLException: path to '/dbfs/mnt/dbacademy-users/{my-user}/data-engineer-learning-path/ecommerce.db': '/dbfs/mnt' does not exist&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After commenting the portion of the code shown below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Move the temp db to the final location
dbutils.fs.mv(f"file:{db_temp_path}", DA.paths.ecommerce_db)
DA.paths.ecommerce_db = DA.paths.ecommerce_db #.replace("dbfs:/", "/dbfs/")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Error in SQL statement: SQLException: path to 'dbfs:/mnt/dbacademy-users/{my-user}/data-engineer-learning-path/ecommerce.db': '/databricks/driver/dbfs:' does not exist&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have no idea how to debug this one. If anyone knows how to solve this, I will really appreciate it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Databricks should update this notebooks...&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2023 23:46:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/training-offerings/error-in-data-engineering-2-2-notebook-when-executing-sql/m-p/37992#M74</guid>
      <dc:creator>leandrob13</dc:creator>
      <dc:date>2023-07-19T23:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Data Engineering 2.2 notebook when executing SQL statement</title>
      <link>https://community.databricks.com/t5/training-offerings/error-in-data-engineering-2-2-notebook-when-executing-sql/m-p/59072#M374</link>
      <description>&lt;P&gt;I have the same issue any tip to resolve the issue?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 16:22:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/training-offerings/error-in-data-engineering-2-2-notebook-when-executing-sql/m-p/59072#M374</guid>
      <dc:creator>jonathanchcc</dc:creator>
      <dc:date>2024-02-02T16:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Data Engineering 2.2 notebook when executing SQL statement</title>
      <link>https://community.databricks.com/t5/training-offerings/error-in-data-engineering-2-2-notebook-when-executing-sql/m-p/60110#M377</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/85039"&gt;@leandrob13&lt;/a&gt;&amp;nbsp; I have found a post that helped me with this &lt;A href="https://stackoverflow.com/questions/77278763/read-sqlite-db-file-in-databricks-using-pyspark-facing-path-not-exists-error-in" target="_self"&gt;link&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It seems that the Databricks community edition has some limitations&lt;/P&gt;&lt;P&gt;"T&lt;SPAN&gt;he community edition doesn't support DBFS fuse, so you can't use&amp;nbsp;&lt;/SPAN&gt;/dbfs&lt;SPAN&gt;&amp;nbsp;file path. To access your sqlite database you need to copy file to the local disk using dbutils and then access it from there using the local file path:&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;/dfs dbutils.fs.cp("dbfs:/mnt/dbacademy-users/my-user/data-engineer-learning-path/ecommerce.db", "file:/tmp/ecommerce.db")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;And then modify the load of data&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;DROP TABLE IF EXISTS users_jdbc;

CREATE TABLE users_jdbc
USING JDBC
OPTIONS (
  url = "jdbc:sqlite:/tmp/ecommerce.db",
  dbtable = "users"
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2024 01:56:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/training-offerings/error-in-data-engineering-2-2-notebook-when-executing-sql/m-p/60110#M377</guid>
      <dc:creator>jonathanchcc</dc:creator>
      <dc:date>2024-02-14T01:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Data Engineering 2.2 notebook when executing SQL statement</title>
      <link>https://community.databricks.com/t5/training-offerings/error-in-data-engineering-2-2-notebook-when-executing-sql/m-p/86718#M605</link>
      <description>&lt;P&gt;I had to change to&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;%python&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dbutils.fs.cp(&lt;/SPAN&gt;&lt;SPAN&gt;"dbfs:/mnt/dbacademy-users/YOURUSERID/data-engineering-with-databricks/ecommerce.db"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"file:/tmp/ecommerce.db"&lt;/SPAN&gt;&lt;SPAN&gt;)&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;DROP&lt;/SPAN&gt; &lt;SPAN&gt;TABLE&lt;/SPAN&gt; &lt;SPAN&gt;IF&lt;/SPAN&gt; &lt;SPAN&gt;EXISTS&lt;/SPAN&gt;&lt;SPAN&gt; users_jdbc;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;CREATE&lt;/SPAN&gt; &lt;SPAN&gt;TABLE&lt;/SPAN&gt;&lt;SPAN&gt; users_jdbc&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;USING&lt;/SPAN&gt;&lt;SPAN&gt; JDBC&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;OPTIONS&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;url&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"jdbc:sqlite:/tmp/ecommerce.db"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dbtable &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"users"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 30 Aug 2024 01:57:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/training-offerings/error-in-data-engineering-2-2-notebook-when-executing-sql/m-p/86718#M605</guid>
      <dc:creator>Dibs</dc:creator>
      <dc:date>2024-08-30T01:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error in Data Engineering 2.2 notebook when executing SQL statement</title>
      <link>https://community.databricks.com/t5/training-offerings/error-in-data-engineering-2-2-notebook-when-executing-sql/m-p/96096#M689</link>
      <description>&lt;P&gt;Thanks ..It really helped.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2024 07:24:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/training-offerings/error-in-data-engineering-2-2-notebook-when-executing-sql/m-p/96096#M689</guid>
      <dc:creator>hebied</dc:creator>
      <dc:date>2024-10-25T07:24:09Z</dc:date>
    </item>
  </channel>
</rss>

