<?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: FileReadException error when creating materialized view reading two schemas in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/filereadexception-error-when-creating-materialized-view-reading/m-p/99947#M40154</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/124321"&gt;@kalebkemp&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The error you're encountering (com.databricks.sql.io.FileReadException) when creating a materialized view that reads from two different schemas in the same catalog might not necessarily be a Databricks limitation. It is more likely related to permissions, configuration issues, or unsupported behavior in the way the materialized view accesses the data. Let’s walk through potential reasons and solutions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Check permissions&lt;/STRONG&gt;: Ensure SELECT and USAGE privileges are granted for all referenced schemas and tables.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Verify storage locations&lt;/STRONG&gt;: Ensure both tables are in compatible storage systems and paths.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Create intermediate views or tables&lt;/STRONG&gt;: Consolidate data from both schemas into a single source before creating the materialized view.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Check for broken file references&lt;/STRONG&gt;: Verify and repair any issues with the underlying Delta tables.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Consider using standard views&lt;/STRONG&gt;: If materialized views are too restrictive, use standard views for flexibility.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;By following these steps, you should be able to resolve the FileReadException and create the materialized view successfully. Let me know if you need further clarification or assistance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;</description>
    <pubDate>Mon, 25 Nov 2024 12:21:29 GMT</pubDate>
    <dc:creator>agallard</dc:creator>
    <dc:date>2024-11-25T12:21:29Z</dc:date>
    <item>
      <title>FileReadException error when creating materialized view reading two schemas</title>
      <link>https://community.databricks.com/t5/data-engineering/filereadexception-error-when-creating-materialized-view-reading/m-p/92604#M38475</link>
      <description>&lt;P&gt;Hi all. I'm getting an error `com.databricks.sql.io.FileReadException` when attempting to create a materialized view which reads tables from two different schemas in the same catalog. Is this just a limitation in databricks or do I potentially have some configuration issue? If I take out any reference to the other schema I'm able to create the view just fine. I can provide a stack trace or more information if necessary.&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;this works:&lt;BR /&gt;create materialized view my_catalog.my_schema.kk_test as select * from my_catalog.my_schema.some_table&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;this does not work:&lt;BR /&gt;create materialized view my_catalog.my_schema.kk_test1 as select * from my_catalog.my_other_schema.some_table&lt;BR /&gt;&lt;BR /&gt;(this is a very simplified version, I do actually need data from both schemas)&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 17:27:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/filereadexception-error-when-creating-materialized-view-reading/m-p/92604#M38475</guid>
      <dc:creator>kalebkemp</dc:creator>
      <dc:date>2024-10-02T17:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: FileReadException error when creating materialized view reading two schemas</title>
      <link>https://community.databricks.com/t5/data-engineering/filereadexception-error-when-creating-materialized-view-reading/m-p/99863#M40119</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/124321"&gt;@kalebkemp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please check if this is not an access issue?:&lt;/P&gt;
&lt;P&gt;SHOW GRANTS ON SCHEMA my_catalog.my_other_schema;&lt;/P&gt;
&lt;P&gt;Also test if you can successfully run a query that access data from both schemas:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SELECT *
FROM my_catalog.my_schema.some_table
JOIN my_catalog.my_other_schema.some_table
ON &amp;lt;join_condition&amp;gt;;&lt;/LI-CODE&gt;
&lt;P&gt;If this query fails, it confirms that the issue is with access or configuration rather than the materialized view creation itself.&lt;/P&gt;
&lt;P&gt;Can you also please share the complete&amp;nbsp;com.databricks.sql.io.FileReadException stacktrace?&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2024 18:43:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/filereadexception-error-when-creating-materialized-view-reading/m-p/99863#M40119</guid>
      <dc:creator>VZLA</dc:creator>
      <dc:date>2024-11-23T18:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: FileReadException error when creating materialized view reading two schemas</title>
      <link>https://community.databricks.com/t5/data-engineering/filereadexception-error-when-creating-materialized-view-reading/m-p/99947#M40154</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/124321"&gt;@kalebkemp&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The error you're encountering (com.databricks.sql.io.FileReadException) when creating a materialized view that reads from two different schemas in the same catalog might not necessarily be a Databricks limitation. It is more likely related to permissions, configuration issues, or unsupported behavior in the way the materialized view accesses the data. Let’s walk through potential reasons and solutions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Check permissions&lt;/STRONG&gt;: Ensure SELECT and USAGE privileges are granted for all referenced schemas and tables.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Verify storage locations&lt;/STRONG&gt;: Ensure both tables are in compatible storage systems and paths.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Create intermediate views or tables&lt;/STRONG&gt;: Consolidate data from both schemas into a single source before creating the materialized view.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Check for broken file references&lt;/STRONG&gt;: Verify and repair any issues with the underlying Delta tables.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Consider using standard views&lt;/STRONG&gt;: If materialized views are too restrictive, use standard views for flexibility.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;By following these steps, you should be able to resolve the FileReadException and create the materialized view successfully. Let me know if you need further clarification or assistance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 12:21:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/filereadexception-error-when-creating-materialized-view-reading/m-p/99947#M40154</guid>
      <dc:creator>agallard</dc:creator>
      <dc:date>2024-11-25T12:21:29Z</dc:date>
    </item>
  </channel>
</rss>

