<?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 Skipping malformed records when reading Avro-files in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/skipping-malformed-records-when-reading-avro-files/m-p/165572#M55449</link>
    <description>&lt;P&gt;&lt;SPAN class=""&gt;Using &lt;A href="https://docs.databricks.com/aws/en/sql/language-manual/functions/read_files" target="_self"&gt;read_files&lt;/A&gt; to read Avro-formatted blobs from an external location, I get the error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;gt; Malformed records are detected in record parsing: Event 0. Parse Mode: FAILFAST. To process malformed records as null result, try setting the option 'mode' as 'PERMISSIVE'. SQLSTATE: 22023&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Now, I have tried to configure this mode using "mode =&amp;gt; 'PERMISSIVE'". Somehow it doesn't seem to kick in:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN class=""&gt;&lt;EM&gt;Parse Mode: FAILFAST. To process malformed records as null result, try setting the option 'mode' as 'PERMISSIVE'.&lt;/EM&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;According to the &lt;A href="https://docs.databricks.com/aws/en/spark/api-options#avro" target="_self"&gt;documentation&lt;/A&gt;, mode should be a supported option for Avro. Note that the &lt;A href="https://docs.databricks.com/aws/en/sql/language-manual/functions/read_files#format-specific-options" target="_self"&gt;documentation for read_files&lt;/A&gt; provides the link to these format-specific options.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Aug 2026 20:30:49 GMT</pubDate>
    <dc:creator>Malthe</dc:creator>
    <dc:date>2026-08-12T20:30:49Z</dc:date>
    <item>
      <title>Skipping malformed records when reading Avro-files</title>
      <link>https://community.databricks.com/t5/data-engineering/skipping-malformed-records-when-reading-avro-files/m-p/165572#M55449</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;Using &lt;A href="https://docs.databricks.com/aws/en/sql/language-manual/functions/read_files" target="_self"&gt;read_files&lt;/A&gt; to read Avro-formatted blobs from an external location, I get the error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;gt; Malformed records are detected in record parsing: Event 0. Parse Mode: FAILFAST. To process malformed records as null result, try setting the option 'mode' as 'PERMISSIVE'. SQLSTATE: 22023&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Now, I have tried to configure this mode using "mode =&amp;gt; 'PERMISSIVE'". Somehow it doesn't seem to kick in:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN class=""&gt;&lt;EM&gt;Parse Mode: FAILFAST. To process malformed records as null result, try setting the option 'mode' as 'PERMISSIVE'.&lt;/EM&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;According to the &lt;A href="https://docs.databricks.com/aws/en/spark/api-options#avro" target="_self"&gt;documentation&lt;/A&gt;, mode should be a supported option for Avro. Note that the &lt;A href="https://docs.databricks.com/aws/en/sql/language-manual/functions/read_files#format-specific-options" target="_self"&gt;documentation for read_files&lt;/A&gt; provides the link to these format-specific options.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2026 20:30:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/skipping-malformed-records-when-reading-avro-files/m-p/165572#M55449</guid>
      <dc:creator>Malthe</dc:creator>
      <dc:date>2026-08-12T20:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Skipping malformed records when reading Avro-files</title>
      <link>https://community.databricks.com/t5/data-engineering/skipping-malformed-records-when-reading-avro-files/m-p/165579#M55450</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/9268"&gt;@Malthe&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;read_files accepts format-specific options, but the Avro option table has an important scope column. For mode, that scope is only from_avro, not Avro file reads. Spark documents it as:&lt;/P&gt;&lt;P&gt;"mode … allows you to specify parse mode for function from_avro"&lt;/P&gt;&lt;P&gt;As a workaround,&amp;nbsp; if your blobs are raw Avro-encoded records/messages, rather than standard Avro Object Container Files, read them as binary and use from_avro, where mode = PERMISSIVE really is supported:&lt;/P&gt;&lt;P&gt;SELECT&lt;BR /&gt;from_avro(&lt;BR /&gt;content,&lt;BR /&gt;'&amp;lt;avro schema&amp;gt;',&lt;BR /&gt;map('mode', 'PERMISSIVE')&lt;BR /&gt;) AS decoded&lt;BR /&gt;FROM read_files(&lt;BR /&gt;'s3://bucket/path',&lt;BR /&gt;format =&amp;gt; 'binaryFile'&lt;BR /&gt;);&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2026 21:34:16 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/skipping-malformed-records-when-reading-avro-files/m-p/165579#M55450</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2026-08-12T21:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Skipping malformed records when reading Avro-files</title>
      <link>https://community.databricks.com/t5/data-engineering/skipping-malformed-records-when-reading-avro-files/m-p/165594#M55451</link>
      <description>&lt;P&gt;Thanks for the workaround!&lt;BR /&gt;&lt;BR /&gt;That said, I do think this is if nothing else, a documentation issue with Databricks.&lt;BR /&gt;&lt;BR /&gt;Documentation says:&lt;BR /&gt;&amp;gt;&amp;nbsp;For options specific to each file format (JSON, CSV, XML, Parquet, Avro, text, ORC, and binary), see &lt;A class="" href="https://docs.databricks.com/aws/en/spark/api-options#batch-read-options" target="_blank" rel="noopener"&gt;DataFrameReader options&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;The first line here is:&lt;BR /&gt;&amp;gt;&amp;nbsp;Use these options with &lt;A class="" href="https://docs.databricks.com/aws/en/pyspark/reference/classes/dataframereader/option" target="_blank" rel="noopener"&gt;DataFrameReader.option()&lt;/A&gt;, &lt;A class="" href="https://docs.databricks.com/aws/en/pyspark/reference/classes/dataframereader/options" target="_blank" rel="noopener"&gt;DataFrameReader.options()&lt;/A&gt;, &lt;A class="" href="https://docs.databricks.com/aws/en/sql/language-manual/functions/read_files" target="_blank" rel="noopener"&gt;read_files&lt;/A&gt;, &lt;A class="" href="https://docs.databricks.com/aws/en/sql/language-manual/delta-copy-into" target="_blank" rel="noopener"&gt;COPY INTO&lt;/A&gt;, and &lt;A class="" href="https://docs.databricks.com/aws/en/ingestion/cloud-object-storage/auto-loader/" target="_blank" rel="noopener"&gt;Auto Loader&lt;/A&gt; to control how Databricks reads data files.&lt;BR /&gt;&lt;BR /&gt;I don't see anything about a "scope".&lt;BR /&gt;&lt;BR /&gt;For mode specifically:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Parser mode for handling corrupt records. FAILFAST throws an exception. PERMISSIVE sets malformed fields to null. DROPMALFORMED silently drops bad records.&lt;/P&gt;&lt;P&gt;Would be a lot more elegant if this worked the way it's documented (at least how I read it).&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2026 06:34:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/skipping-malformed-records-when-reading-avro-files/m-p/165594#M55451</guid>
      <dc:creator>Malthe</dc:creator>
      <dc:date>2026-08-13T06:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: Skipping malformed records when reading Avro-files</title>
      <link>https://community.databricks.com/t5/data-engineering/skipping-malformed-records-when-reading-avro-files/m-p/165597#M55453</link>
      <description>&lt;P&gt;Yeah, agree with you. It's confusing to say the least&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2026 07:58:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/skipping-malformed-records-when-reading-avro-files/m-p/165597#M55453</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2026-08-13T07:58:34Z</dc:date>
    </item>
  </channel>
</rss>

