<?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 when query event log: Cannot read more than one event logs in the same query in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/error-when-query-event-log-cannot-read-more-than-one-event-logs/m-p/89252#M37742</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/109070"&gt;@guangyi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for sharing solution with community!&lt;/P&gt;</description>
    <pubDate>Tue, 10 Sep 2024 07:57:39 GMT</pubDate>
    <dc:creator>szymon_dybczak</dc:creator>
    <dc:date>2024-09-10T07:57:39Z</dc:date>
    <item>
      <title>Error when query event log: Cannot read more than one event logs in the same query</title>
      <link>https://community.databricks.com/t5/data-engineering/error-when-query-event-log-cannot-read-more-than-one-event-logs/m-p/89109#M37695</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I try to follow the instructions of &lt;A href="https://docs.databricks.com/en/delta-live-tables/observability.html#querying-the-event-log" target="_self"&gt;Monitor Delta Live Tables pipelines&lt;/A&gt; to query dlt.expection log.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is the simple code version I copied from the &lt;A href="https://docs.databricks.com/en/delta-live-tables/observability.html#unity-catalog" target="_self"&gt;Querying the event log section&lt;/A&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;CREATE TEMPORARY LIVE VIEW event_log_raw AS (SELECT * FROM event_log(TABLE(`catalog`.`schema`.`table`)));

CREATE OR REFRESH MATERIALIZED VIEW event_log_raw_1
AS
(SELECT * FROM event_log_raw LIMIT 1);&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;However, after I put the code into a DLT pipeline and running, it tell me something goes wrong:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;org.apache.spark.sql.catalyst.ExtendedAnalysisException: Unable to process statement for View 'event_log_raw'.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;java.lang.UnsupportedOperationException: Cannot read more than one event logs in the same query&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;org.apache.spark.SparkException: A pipeline with a different id is already registered in this Credential Scope. The pipeline in a CredentialScope cannot be updated once it is registered.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;I cannot find the related search result for this error message anywhere, what’s wrong with my code?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 03:01:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-when-query-event-log-cannot-read-more-than-one-event-logs/m-p/89109#M37695</guid>
      <dc:creator>guangyi</dc:creator>
      <dc:date>2024-09-09T03:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error when query event log: Cannot read more than one event logs in the same query</title>
      <link>https://community.databricks.com/t5/data-engineering/error-when-query-event-log-cannot-read-more-than-one-event-logs/m-p/89130#M37700</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/109070"&gt;@guangyi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Yeah, bit weird error.&amp;nbsp;In your case, the error message you’re seeing suggests that there is an issue with querying the event logs because Delta Live Tables (DLT) only allows one instance of the event_log&amp;nbsp;to be read in a single query.&lt;BR /&gt;Could you try to remove below part from your pipeline? Just for a test:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;CREATE OR REFRESH MATERIALIZED VIEW event_log_raw_1
AS
(SELECT * FROM event_log_raw LIMIT 1);&lt;/LI-CODE&gt;&lt;P&gt;Also, make sure your environment aligns with following requirements of event_log TVF:&lt;BR /&gt;&lt;BR /&gt;-&amp;nbsp;&lt;SPAN&gt;To call the event_log, you must use a shared cluster or a SQL warehouse.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;- The event_log TVF can be called only by the pipeline owner and view created over the event_log.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 06:18:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-when-query-event-log-cannot-read-more-than-one-event-logs/m-p/89130#M37700</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2024-09-09T06:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Error when query event log: Cannot read more than one event logs in the same query</title>
      <link>https://community.databricks.com/t5/data-engineering/error-when-query-event-log-cannot-read-more-than-one-event-logs/m-p/89232#M37733</link>
      <description>&lt;P&gt;&lt;SPAN&gt;H &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/110502"&gt;@szymon_dybczak&lt;/a&gt;&amp;nbsp;, thank you for the advice. After investigating the problem has been solved.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The error message mentioned in the title is not the key, the below error message “A pipeline with a different id is already registered in this Credential Scope. The pipeline in a CredentialScope cannot be updated once it is registered” leads me to a similar question with the answer: &lt;/SPAN&gt;&lt;A href="https://community.databricks.com/t5/data-engineering/describe-table-extended-on-materialized-views-uc-dlt-and-cluster/m-p/63971/highlight/true#M32421" target="_blank"&gt;&lt;SPAN&gt;https://community.databricks.com/t5/data-engineering/describe-table-extended-on-materialized-views-uc-dlt-and-cluster/m-p/63971/highlight/true#M32421&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The reason why this issue happened is because I isolated this SQL task(file) into an independent pipeline. So the way to fix it is just merge the event query task with the pipeline which generates the target table together.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;bronze_pipeline:
      libraries:
        - file:
            path: ./bronze/pipeline.py
        - file:
            path: ./bronze/data_quality_check.sql&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2024 01:55:33 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-when-query-event-log-cannot-read-more-than-one-event-logs/m-p/89232#M37733</guid>
      <dc:creator>guangyi</dc:creator>
      <dc:date>2024-09-10T01:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Error when query event log: Cannot read more than one event logs in the same query</title>
      <link>https://community.databricks.com/t5/data-engineering/error-when-query-event-log-cannot-read-more-than-one-event-logs/m-p/89252#M37742</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/109070"&gt;@guangyi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for sharing solution with community!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2024 07:57:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-when-query-event-log-cannot-read-more-than-one-event-logs/m-p/89252#M37742</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2024-09-10T07:57:39Z</dc:date>
    </item>
  </channel>
</rss>

