<?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: Data Engineering with Databricks Module 6.3L Error: Autoload CSV in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/data-engineering-with-databricks-module-6-3l-error-autoload-csv/m-p/27656#M19517</link>
    <description>&lt;P&gt;Yes recently it was improved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 16 Oct 2022 19:04:05 GMT</pubDate>
    <dc:creator>Hubert-Dudek</dc:creator>
    <dc:date>2022-10-16T19:04:05Z</dc:date>
    <item>
      <title>Data Engineering with Databricks Module 6.3L Error: Autoload CSV</title>
      <link>https://community.databricks.com/t5/data-engineering/data-engineering-with-databricks-module-6-3l-error-autoload-csv/m-p/27653#M19514</link>
      <description>&lt;P&gt;I am currently taking the Data Engineering with Databricks course and have run into an error. I have also attempted this with my own data and had a similar error. In the lab, we are using autoloader to read a spark stream of csv files saved in the DBFS. The answer for this lab is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;# ANSWER
customers_checkpoint_path = f"{DA.paths.checkpoints}/customers"
&amp;nbsp;
(spark.readStream
      .format("cloudFiles")
      .option("cloudFiles.format", "csv")
      .option("cloudFiles.schemaLocation", customers_checkpoint_path)
      .load("/databricks-datasets/retail-org/customers/")
      .createOrReplaceTempView("customers_raw_temp"))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This results in an error message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;java.lang.UnsupportedOperationException: Schema inference is not supported for format: csv. Please specify the schema.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that when using csv, a pre-defined schema is required. I attempted with my personal databricks data and had to create a schema first, then add that schema to my stream:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;schema = StructType([
  StructField("Test1",StringType(),True),
  StructField("Test2",StringType(),True),
  StructField("Test3",StringType(),True)])
&amp;nbsp;
spark.readStream
                  .format("cloudFiles")
                  .option("cloudFiles.format", source_format)
                  .option("header", "True")
                  .schema(schema)
                  .load(data_source)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is this the best solution for this error or is there a way for autoloader to get the schema as shown in the solution to the Databricks lab?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 20:30:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/data-engineering-with-databricks-module-6-3l-error-autoload-csv/m-p/27653#M19514</guid>
      <dc:creator>Dave_Nithio</dc:creator>
      <dc:date>2022-10-12T20:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Data Engineering with Databricks Module 6.3L Error: Autoload CSV</title>
      <link>https://community.databricks.com/t5/data-engineering/data-engineering-with-databricks-module-6-3l-error-autoload-csv/m-p/27654#M19515</link>
      <description>&lt;P&gt;After a bit more research, it looks like I was using a cluster with an outdated DBR. I updated to 11.1 and no longer received the error&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 20:46:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/data-engineering-with-databricks-module-6-3l-error-autoload-csv/m-p/27654#M19515</guid>
      <dc:creator>Dave_Nithio</dc:creator>
      <dc:date>2022-10-12T20:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Data Engineering with Databricks Module 6.3L Error: Autoload CSV</title>
      <link>https://community.databricks.com/t5/data-engineering/data-engineering-with-databricks-module-6-3l-error-autoload-csv/m-p/27655#M19516</link>
      <description>&lt;P&gt;As a small aside, you don't need the third argument in the structfields &lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 23:02:32 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/data-engineering-with-databricks-module-6-3l-error-autoload-csv/m-p/27655#M19516</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-12T23:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Data Engineering with Databricks Module 6.3L Error: Autoload CSV</title>
      <link>https://community.databricks.com/t5/data-engineering/data-engineering-with-databricks-module-6-3l-error-autoload-csv/m-p/27656#M19517</link>
      <description>&lt;P&gt;Yes recently it was improved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2022 19:04:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/data-engineering-with-databricks-module-6-3l-error-autoload-csv/m-p/27656#M19517</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-10-16T19:04:05Z</dc:date>
    </item>
  </channel>
</rss>

